Second Tier Backups
My company does an automatic daily Dirvish backup of several servers to the /backup bank (backup server's local drives) and a (manually launched) weekly backup to the /offsite bank (a pack of removable PATA drives in an array enclosure).
cron launches the daily backup just after midnight and it usually finishes before 08:15. Ninety percent of the time, the backup job runs flawlessly. Once in a while, there is an rsync_error or some network connectivity issue, though.
Every Tuesday morning after Dirvish notifies me that it's finished the daily backup, I mount the removable drives and start the offsite backup script. The job that takes eight hours on a nearly idle network can take 15 or 20 hours when users are actively updating. This would be much faster if Dirvish could just grab the most recent successful daily backup, but it's not really designed to hit a moving target. I also want to make sure my offsite backup contains only good data. A few days ago, I got a brainstorm to use a pair of symbolic links to track the most recent successful backup. Now I'm running my offsite backup much faster! The only difference in this approach is that I'm effectively taking my weekly snapshot a few hours earlier.
My master.conf file has a new line:
... post-server: /usr/local/bin/update_symlink ...
and here's my shell script to update the symbolic link:
/usr/local/bin/update_symlink
...
#!/bin/sh
cd $DIRVISH_DEST/../..
# test for failure
if [ -x /$DIRVISH_DEST/../rsync_error ]; then
rm current
cp recent current
echo "Keeping pointer to recent backup"
else
rm recent
mv current recent
ln -s $DIRVISH_DEST current
echo "Updated pointer to current backup"
fi
...Now the daily backup job's default.conf still says:
...
client: {target-server}
tree: /
...But the offsite job's default.conf file says:
...
client: localhost
tree: /backup/{target-server}/current
...Daniel Petcher (moc tod pa ta pleinad, backwards)
You can achieve the same result by using the image-temp config setting like this:
image-temp: current
