Home

Charles N Wyble Journal

TODO List Progress: Backups

Charles Nathaniel Wyble

TODO List Progress: Backups

Previous Entry Add to Memories Tell a Friend Next Entry
Well its taken longer then I had hoped, but I am almost done with backups. Please see my previous posts on the topic for some background and earlier attempts.

I have done a number of experiments and test runs, and have come up with the following:

1) A set of scripts on my file server which run out of cron and ssh to the server which hosts my personal home page, and the server which hosts all my corporate pages. It backs up my web pages and e-mail directory. The script is fairly simple:

#!/bin/bash
#A script to backup the content of my vpsland.com sites and my personal homepage


backup_root="/samba/backups"
backup_storage_root="$backup_root/backups/web-backups/"
logFile="$backup_root/logs/remote-backup.log"
private_key="$backup_root/keys/privateBackupKey"
rsync_opts="-avz"

echo "To: charles@thewybles.com" > ${logFile}
echo "From: remote-backup@thewybles.com" >> ${logFile}
echo "Subject: E-mail/Web Backup Ran `date`" >> ${logFile}
echo "" >> ${logFile}
echo "Starting E-mail/Web Backup `date`" >> ${logFile}

echo "" >> ${logFile}

rsync $rsync_opts -e "ssh -i $private_key" charles@www.socallugs.com:/home/charles/web $backup_storage_root/vpsland-backup
backupReturnValue=$?
echo "VPSLAND webpage backups returned $backupReturnValue" >> ${logFile}

rsync $rsync_opts -e "ssh -i $private_key" charles@www.socallugs.com:/home/charles/web $backup_storage_root/vpsland-backup
backupReturnValue=$?
echo "VPSLAND webpage backups returned $backupReturnValue" >> ${logFile}

rsync $rsync_opts -e "ssh -p 2345 -i $private_key" charles@www.thewybles.com:/home/charles/public_html $backup_storage_root/homepage-backup
backupReturnValue=$?
echo "Homepage backup returned $backupReturnValue" >> ${logFile}

rsync $rsync_opts -e "ssh -p 2345 -i $private_key" charles@www.thewybles.com:/home/charles/Maildir $backup_storage_root/email-backup
backupReturnValue=$?
echo "E-mail backup returned $backupReturnValue" >> ${logFile}

cat ${logFile} | /usr/sbin/sendmail -t -i

2) A script which backs up the music and pictures on the media server. Same as above just different source server and local storage point.
3) A script which backs up web pages and e-mail to rsync.net. Same as above script just different source and target server.

The above 3 scripts have been running for a week or so (maybe longer I dunno) and work perfectly.

The following tasks remain:

1) Backing up Patti and I laptop.
2) Backing up local VmWare servers.

Both of the above should be doable with the above script, however I have run into a problem attempting to set it up. So going to work on that later today.

3) Backing up MySQL databases. Part of me wants to do a mysqldump, and part of me wants to setup a MySQL replica. In the interest of time and simplicity, I think I'll do the mysqldump.

So if everything goes well, I should have backups finished by the end of the day today.
  • It works now

    Got backups working. My main issue was the wrong exclude option. I needed to use -exclude-from=excludefile. Once I figured that out I was good to go.

    Doing initial (full) backups of my vmware systems now. Then I will backup the laptops.
Powered by LiveJournal.com