The other day I was looking for a backup solution for two laptops. While I was unable to get the exact results I was looking for I did create a nice bash script that detects the network, and if on my local network it will mount the share from my Airport Extreme and then rsync the data over. I am sure there is plenty of room for improvement on this script, but it works quite well.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/bin/sh ############################ # iTunes Rsync Cron Script # ############################ ap=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | sed -e "s/^ *SSID: //p" -e d` if [ $ap == "oxygen" ] then clear echo "You are connected to Oxygen." echo "Backup will now begin." echo "Mounting network drive." sudo mkdir /Volumes/music_backup sudo /sbin/mount_afp afp://oxygen.local/Storage/ /Volumes/music_backup/ sudo /usr/bin/rsync --exclude .DS_Store --exclude .Trash --stats --progress --inplace --no-owner --no-group -vhlrutD --delete /Users/shelby/Music/iTunes/iTunes\ Media/Music/* /Volumes/music_backup/Music/shelby/ echo "Unmounting network drive." sudo /sbin/umount /Volumes/music_backup echo "Backup is complete." else clear echo "You are not connected to Oxygen. Music will not be backed up at this time." |







