Last active
October 17, 2020 18:42
-
-
Save felixhummel/2cdc91c92cd6798ca2c318348de9425a to your computer and use it in GitHub Desktop.
borg backup script
This file contains 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 | |
set -euo pipefail | |
[[ $UID == 0 ]] | |
export BORG_REPO=/media/backup/borg/foo | |
export BORG_PASSPHRASE="TODO change this to a secret passphrase" | |
borg create \ | |
--filter AME \ | |
--exclude-caches \ | |
--exclude /root/configs \ | |
--exclude /root/.cache \ | |
--one-file-system \ | |
--numeric-owner \ | |
::'auto-{now}' \ | |
/etc /opt /root /srv /var/lib/docker/volumes \ | |
/home/felix/.bin/ | |
borg prune --keep-daily=8 --keep-weekly=5 --keep-monthly=7 --keep-yearly=3 |
This file contains 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
# m h dom mon dow command | |
37 3 * * * /media/backup/bin/backup.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://borgbackup.readthedocs.io/