Created
February 11, 2020 14:27
-
-
Save mrysav/f1948d148f3cfc7ede9e360c90ef7435 to your computer and use it in GitHub Desktop.
Restic Backup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # not needed if using packaged version | |
| restic self-update | |
| # Assumes you have RESTIC_REPOSITORY and RESTIC_PASSWORD_COMMAND set | |
| # Refresh credentials here, if applicable | |
| # Bail if restic is already running, maybe previous run didn't finish | |
| if pidof -x restic >/dev/null; then | |
| echo "Backup already running" | |
| exit | |
| fi | |
| restic --verbose backup ~/ --exclude-file="$HOME/.restic_excludes" | |
| restic forget --keep-weekly 4 --prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment