Thought I would share what I am doing to backup my important stuff to an external drive.
Of course, I am using time machine (available in MAC OS X 10.5.x Leopard only) as well, so this is a backup in addition to timemachine, for ease of mind! And, personally I don’t want to trust the 200GB+ of music, photos, videos to only one backup method — I want this data for the long run!
OK so my system is a mac book pro, has a 250 GB hard drive (which I upgraded myself) in it, and I have several external drives…the one we will be backing up to is a Lacie Biggest Quadra which I scored off of Amazon a few months ago. The Lacie drive is an external 2TB RAID array with 4 500GB Drives. I have it configured in RAID 5 mode, which brings the capacity down to about 1.5TB or 1500 GB.
Using vi in the terminal, I wrote this shell script to grab all of my important data (user folder, pictures, video, music) and sync it to my RAID array:
#!/bin/bash# This is a backup script I wrote to rsync files from various locations to my RAID5 array
# set variables
coms='rsync -aqu --delete'
raid5=/Volumes/RAID5/backups # RAID5 BACKUP DIR
raid5pics=/Volumes/RAID5/backups/pics
user=/Users/joshtrefethen
pics=/Volumes/GDRIVE/$coms $user $raid5
$coms --exclude '.*' $pics $raid5pics
I then configured what most unix users would call a cron job – or an automated task that runs every 15 minutes and executes the script. I found that in Mac OS X 10.5 Leopard, it is a little more tricky to set up an automated task then I am used to in other unix OSs. You can simply setup a cron job…
In Mac OS X 10.5.x Leopard, you need to work with a system called launchd. you can do this my using a text editor or vi in the terminal, or you can use a neat little piece of open source software called Lingon.
From the Lingon site:
Lingon is a graphical user interface for creating launchd configuration files for Mac OS X Leopard (10.5). You get all your launchd configuration files listed hierarchically so you can easily see all and choose which one to edit. Editing a configuration file is easier than ever in this version and the most common settings are readily available.
Lingon allows you to create ‘cron jobs’ in leopard.
my cron job found at /Library/LaunchDaemons/com.joshtrefethen.MyBackups.plist on my macbook pro to execute this script every 30 minutes looks like this:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
GroupName
wheel
Label
com.joshtrefethen.MyBackups.plist
ProgramArguments
sh
/Users/joshtrefethen/backups.sh
StartInterval
1800
UserName
root