Skip to content

Instantly share code, notes, and snippets.

@oxagast
Last active September 28, 2023 16:03
Show Gist options
  • Save oxagast/d359f9208f5979796cc97309907ab395 to your computer and use it in GitHub Desktop.
Save oxagast/d359f9208f5979796cc97309907ab395 to your computer and use it in GitHub Desktop.
# duplicity backup
PASSPHRASE="" # change this
KEYID="" # change this
LOG="/var/log/backup.log"
KEEP="6" # change this
FULLAFTER="1M" # change this
SITEONE="rsync://marshall@conductor//backups/viscosity/" # site 1 (use pubkey auth)
SITETWO="file:///var/backups/system/viscosity/" # site 2
echo "Starting backup to SITEONE..."
duplicity --progress --log-file $LOG --asynchronous-upload --full-if-older-than 1M --encrypt-key $KEYID \
--exclude /var/tmp --exclude /var/run --exclude /var/lock --exclude /home/*/.cache --exclude /root/.cache \
--include /home --include /etc --include /usr/local --include /root --include /var \
--include /srv/storage/External/Hacking --exclude '**' / $SITEONE
duplicity --progress remove-all-but-n-full $KEEP --force $SITEONE
echo "Starting backup to SITETWO..."
duplicity --progress --log-file $LOG --asynchronous-upload --full-if-older-than 1M --encrypt-key $KEYID \
--exclude /var/tmp --exclude /var/run --exclude /var/lock --exclude /home/*/.cache --exclude /root/.cache \
--include /home --include /etc --include /usr/local --include /root --include /var \
--include /srv/storage/External/Hacking --exclude '**' / $SITETWO
duplicity --progress remove-all-but-n-full $KEEP --force $SITETWO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment