1

I'm making daily incremental backups and monthly full backups, both with duplicity

Daily backup script (in /etc/cron.daily/)

#!/bin/sh

adddate() {
    while IFS= read -r line; do
        printf '%s %s\n' "$(date):" "$line";
    done
}

# be sure external drives are mounted
mount -a

# backup to HDD backup B, using duplicity 
echo "\n\nBacking up /home and /etc into /mnt/backupB with duplicity (incremental backup)" | adddate >> /var/log/daily-backup.log 2>&1
export PASSPHRASE=****
duplicity --exclude='**/.cache/' --include /home --include /etc --exclude '**' / file:///mnt/backupB | adddate >> /var/log/daily-backup.log 2>&1
unset PASSPHRASE

Monthly backup script (in /etc/cron.monthly/)

#!/bin/sh

adddate() {
    while IFS= read -r line; do
        printf '%s %s\n' "$(date):" "$line";
    done
}

# be sure external drives are mounted
mount -a

# backup to HDD backup B, using duplicity
echo "\n\nBacking up /home and /etc into /mnt/backupB with duplicity (full backup)" | adddate >> /var/log/monthly-backup.log 2>&1
export PASSPHRASE=*****
duplicity full --exclude='**/.cache/' --include /home --include /etc --exclude '**' / file:///mnt/backupB | adddate >> /var/log/monthly-backup.log 2>&1
unset PASSPHRASE

My question is: when and where shall I use duplicity verify? After incremental or full or both?

2
  • 1
    Note that verify only checks the self-integrity of files within the backup. You need --compare-data to compare with the source, see here. To improve confidence perhaps consider alternating each month between 2 backup discs, and manually trying to restore an old random file a few times a year.
    – meuh
    Commented Jan 23, 2023 at 10:45
  • 1
    --compare-data is quite useless when your data changes after the backup was taken. verify restores the last backup's content (when run w/o --time parameter) file by file locally and will make sure that the backup is restorable, else it will throw an error. Commented Jan 23, 2023 at 14:10

1 Answer 1

2

personally i verify every backup after it was taken. depending on the result cron sends an email or proceeds with purging old backups. after all backup is about data safety. this is done using duply with conditional batch commands as cronjobs (disclosure: i'm the duply maintainer).

it's advisable to make the frequency of verification depending on limiting factors like general backup size, bandwidth constraints, cloud storage transfer costs or local cpu power limitations.

as you seem to be backing up to a local hard drive i'd assume none of the above matter, so doing verification as often as possible would be cheap to have one would assume.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .