Skip to content

Instantly share code, notes, and snippets.

@felixhummel
Last active October 17, 2020 18:42
Show Gist options
  • Save felixhummel/2cdc91c92cd6798ca2c318348de9425a to your computer and use it in GitHub Desktop.
Save felixhummel/2cdc91c92cd6798ca2c318348de9425a to your computer and use it in GitHub Desktop.
borg backup script
#!/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
# m h dom mon dow command
37 3 * * * /media/backup/bin/backup.sh
@felixhummel
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment