duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] My Incremental and Full Scripts


From: Jon
Subject: [Duplicity-talk] My Incremental and Full Scripts
Date: Mon, 24 Nov 2008 12:59:20 -0400
User-agent: Thunderbird 2.0.0.17 (X11/20080925)

Hi All,

I'm not sure how useful this is, but since there seems to be repeated questions about the best way to set up full and incremental backups, I thought I would post the scripts I use.

I'm not saying that my way is the best way, just that it is a way and I've been using it for several months. I've done periodic test restores and they always work, so I feel good about the setup.

I run two scripts: a full and an incremental script. I run the full each Sunday night at 11PM and the incremental every other night at 11pm.

I keep 14 days of backups, I backup Thunderbird's IMAP email, and my backup server runs SSH on a non-standard port.

You'll need to change anything munged, localuser to be a local user on your machine, localmachine to your host name (optional), admin.server.com to your own backup server, and probably the SSH port (not required at all if you're running SSH on port 22). These scripts logs all their actions as well as report the available disk space at the end of the backups and emails the reports to me locally just for good measure. I don't always notice if a backup report isn't present, but I have become accustomed to getting the daily backup emails and I notice if they're missing. The incremental also includes collection status reports in the report.

Hope these are useful for someone.

Jon


Here's the full backup script (watch for wrap/formatting errors):

#!/bin/sh
# Export the PASSPHRASE variable
export PASSPHRASE=munged

# Get the date
repDate=`date +%Y%m%d`;

# Cleanup first (anything older than 21 days)
/usr/bin/duplicity remove-older-than 14D -v9 --force scp://address@hidden:2035//backup

# Now do the backup
/usr/bin/duplicity full --include /home/localuser/Documents --include /home/localuser/.mozilla-thunderbird/01pvkqct.default/ImapMail/mail.messagingengine.com --include /home/localuser/scripts --exclude '**' /home/localuser/ scp://address@hidden:2035//backup/localmachine --sign-key MUNGED > /home/localuser/Documents/BackupLogs/Full_Backup_Log_$repDate_localmachine_admin.log

# Get the disk space
echo "Availble Disk Space on Server" >> /home/localuser/Documents/BackupLogs/Full_Backup_Log_$repDate_localmachine_admin.log echo >> /home/localuser/Documents/BackupLogs/Full_Backup_Log_$repDate_localmachine_admin.log /usr/bin/ssh -p2035 address@hidden df -h >> /home/localuser/Documents/BackupLogs/Full_Backup_Log_$repDate_localmachine_admin.log

# Mail me the results
mail -t localuser -s "localmachine Backup Full (Admin)" < /home/localuser/Documents/BackupLogs/Full_Backup_Log_$repDate_localmachine_admin.log

And the incremental script (same

#!/bin/sh
# Export the PASSPHRASE variable
export PASSPHRASE=munged

# Get the date
repDate=`date +%Y%m%d`;

# Cleanup first (anything older than 21 days)
/usr/bin/duplicity remove-older-than 14D -v9 --force scp://address@hidden:2035//backup/localmachine

# Now do the backup
/usr/bin/duplicity --include /home/localuser/Documents --include /home/localuser/.mozilla-thunderbird/01pvkqct.default/ImapMail/mail.messagingengine.com --include /home/localuser/scripts --exclude '**' /home/localuser/ scp://address@hidden:2035//backup/localmachine --sign-key MUNGED > /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log

# Get list of backups
/usr/bin/duplicity collection-status scp://address@hidden:2035//backup/localmachine >> /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log

# Get the disk space
echo "\nAvailble Disk Space on Server" >> /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log echo >> /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log /usr/bin/ssh -p2035 address@hidden df -h >> /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log

# Mail me the results
mail -t localuser -s "localmachine Backup Incremental (Admin)" < /home/localuser/Documents/BackupLogs/Incremental_Backup_Log_${repDate}_localmachine_admin.log





reply via email to

[Prev in Thread] Current Thread [Next in Thread]