Files
duplicity/README.md
2023-09-28 21:34:43 +01:00

2.1 KiB

duplicity

Examples

#!/bin/bash
# Prerequisites
## ssh without password (using ssh-keygen)

# Setup schedule
## create a symbolic link ln -s [source-path/duplicity-backup.sh] /etc/cron.daily/mybackup

suffix=$(date +"%Y%m%d%H%M%S")
encryptKey=zzzzzzz

## home
duplicity --encrypt-key ${encryptKey} remove-all-but-n-full 8 --force sftp://mfadmin@192.168.1.251://backups/devices/homeserver/duplicity/home 2>&1 | tee /var/log/backup_home_${suffix}.log
duplicity --encrypt-key ${encryptKey} --verbosity info --full-if-older-than 7D /home\
 --exclude '**/cache'\
 --exclude '**/.cache'\
 --exclude '**/tmp'\
 --exclude '**/.tmp'\
 sftp://mfadmin@192.168.1.251://backups/devices/homeserver/duplicity/home\
 2>&1 | tee /var/log/backup_home_${suffix}.log

## etc
duplicity --encrypt-key ${encryptKey} remove-all-but-n-full 8 --force sftp://xxx@192.168.1.111://backups/devices/homeserver/duplicity/etc 2>&1 | tee /var/log/backup_etc_${suffix}.log
duplicity --encrypt-key ${encryptKey} --verbosity info --full-if-older-than 7D /etc\
 --exclude '**/cache'\
 --exclude '**/.cache'\
 --exclude '**/tmp'\
 --exclude '**/.tmp'\
 sftp://mfadmin@192.168.1.251://backups/devices/homeserver/duplicity/etc\
 2>&1 | tee /var/log/backup_etc_${suffix}.log

## root
duplicity --encrypt-key ${encryptKey} remove-all-but-n-full 8 --force sftp://xxx@192.168.1.111://backups/devices/homeserver/duplicity/root 2>&1 | tee /var/log/backup_root_${suffix}.log
duplicity --encrypt-key ${encryptKey} --verbosity info --full-if-older-than 7D /root\
 --exclude '**/cache'\
 --exclude '**/.cache'\
 --exclude '**/tmp'\
 --exclude '**/.tmp'\
 sftp://mfadmin@192.168.1.251://backups/devices/homeserver/duplicity/root\
 2>&1 | tee /var/log/backup_root_${suffix}.log

## data
duplicity --encrypt-key ${encryptKey} remove-all-but-n-full 12 --force sftp://xxx@192.168.1.111://backups/devices/homeserver/duplicity/data 2>&1 | tee /var/log/backup_data_${suffix}.log
duplicity --encrypt-key ${encryptKey} --verbosity info --full-if-older-than 7D /data\
 sftp://mfadmin@192.168.1.251://backups/devices/homeserver/duplicity/data\
 2>&1 | tee /var/log/backup_data_${suffix}.log