While we're on the topic, I'll pimp my own wrapper too:
http://github.com/TTimo/dupinanny/
Pretty much same idea, automate incremental vs full, I set it up to
run
from cron on various systems. Has support for breaking down a backup
into several smaller ones, failed backups have to be restarted
completely, since I do full machine backups on a slow link, I wasn't
able to get a single full backup through without breaking things down
a bit.
TTimo
Jon wrote:
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
_______________________________________________
Duplicity-talk mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/duplicity-talk
_______________________________________________
Duplicity-talk mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/duplicity-talk