From 97304834bca0d7227b19e73e29472ea59b1db117 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Mon, 16 May 2022 11:22:12 +0200 Subject: [PATCH] Add backup script --- .bin/backup-home | 16 ++++++++++++++++ .resticexclude | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 .bin/backup-home create mode 100644 .resticexclude diff --git a/.bin/backup-home b/.bin/backup-home new file mode 100755 index 0000000..3e96589 --- /dev/null +++ b/.bin/backup-home @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Back up my $HOME folder to OneDrive using `restic`. +# +# Adds extra flags needed for using `rclone` with sharepoint WebDav I.e. add +# `--ignore-size --ignore-checksum --update` to the default `rclone.args`. +# +# Select directory in repo using -r rclone:: +# +# Runs `backup` command on $HOME and ignore what is listed in `.resticexclude` + +restic \ + -o rclone.args="serve restic --stdio --b2-hard-delete --ignore-size --ignore-checksum --update" \ + -r rclone:onedrive-vub:restic \ + -v backup "$HOME" \ + --exclude-file="$HOME/.resticexclude" diff --git a/.resticexclude b/.resticexclude new file mode 100644 index 0000000..aa7c53e --- /dev/null +++ b/.resticexclude @@ -0,0 +1,19 @@ +# Restic ignore + +# General +.cache +cache +build +.git +node_modules + +# Specifics +$HOME/.atom +$HOME/.cargo +$HOME/.espressif +$HOME/.local/share/torbrowser +$HOME/.mozilla +$HOME/.nvm +$HOME/.npm +$HOME/.nuget +$HOME/doc/disk-images