Hey, I have written a simple script for backing my macbook to a Samba share on my wireless LAN which I autorun using Crontab:
#!/bin/bash
mount_smbfs //bones@storage/Timbackup /Volumes/Timbackup
rsync -vaE --delete /Users/Bones/Documents /Volumes/Timbackup
rsync -vaE --delete --size-only --exclude "iPhoto Library" /Users/Bones/Pictures /Volumes/Timbackup
rsync -vaE --delete --size-only /Users/Bones/Music /Volumes/Timbackup
umount /Volumes/Timbackup
It works fine, but if my macbook is out of range of the LAN the samba share can't mount and the script copies all my data to the local folder /Volumes/Timbackup
This causes the macbook's hard disk to fill up. What I'd like to be able to do is get the script to check whether the share mounted successfully before copying the files.
Any suggestions?
Thanks in advance,
Tim
#!/bin/bash
mount_smbfs //bones@storage/Timbackup /Volumes/Timbackup
rsync -vaE --delete /Users/Bones/Documents /Volumes/Timbackup
rsync -vaE --delete --size-only --exclude "iPhoto Library" /Users/Bones/Pictures /Volumes/Timbackup
rsync -vaE --delete --size-only /Users/Bones/Music /Volumes/Timbackup
umount /Volumes/Timbackup
It works fine, but if my macbook is out of range of the LAN the samba share can't mount and the script copies all my data to the local folder /Volumes/Timbackup
This causes the macbook's hard disk to fill up. What I'd like to be able to do is get the script to check whether the share mounted successfully before copying the files.
Any suggestions?
Thanks in advance,
Tim