Skip to content

Instantly share code, notes, and snippets.

@sergejx
Created July 16, 2019 17:49
Show Gist options
  • Save sergejx/b6527a1a4bb46d43616b6a2ad6137586 to your computer and use it in GitHub Desktop.
Save sergejx/b6527a1a4bb46d43616b6a2ad6137586 to your computer and use it in GitHub Desktop.
Backup using Restic
#!/bin/sh
export RESTIC_REPOSITORY=rest:http://************
export RESTIC_PASSWORD='*************'
EXCLUDES=/home/sergej/.duplicity-exclude
case "$1" in
"")
restic backup /home --exclude-file $EXCLUDES
;;
clean)
restic forget --prune --keep-last 3 --keep-weekly 10 --keep-monthly 12
;;
*)
restic $@
esac
unset -v RESTIC_REPOSITORY RESTIC_PASSWORD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment