|This quality half-terrabyte Western Digital external hard drive is to replace our now broken NAS drive. Instead of using a NAS drive we have created a Samba share on our server which we find more convenient.|
This 2nd drive is for backing up our files using rsync to mirror our primary hard disk.
We map the USB hard disk on our Ubuntu 8.04 machine by putting the following in /etc/fstab:
/dev/sdb1 /home/fotherby/Bitbucket ext3 user,rw 0 0
We call our backup drive “Bitbucket” which is a name we learnt from the IC DOC labs. We do a nightly backup by putting the following script in /etc/cron.daily/ourBackup:
#!/bin/sh rsync -a --delete /home/fotherby/OurStuff /home/fotherby/Bitbucket/CharmeleonMirror/ rsync -a --delete /var/www/tomfotherby /home/fotherby/Bitbucket/CharmeleonMirror/
- -a: Archive. This causes rsync to maintain things like file permissions and ownerships (same as -rlptgoD).
- –delete: This tells rsync to delete files that are no longer on the server from the backup. The delete is done BEFORE any of the new data is transferred.