[X-Unix] Backup script help
Charles Howse
chowse at charter.net
Fri Feb 24 10:10:22 PST 2006
On Feb 24, 2006, at 2:44 AM, dledger at ivdcs.demon.co.uk wrote:
>
> From: Charles Howse <chowse at charter.net>
>> It's working well, with the exception of a couple of things I would
> like some input on.
>
> I would simplify the whole nfs mount check and do something like
> (untested & written in webmail at a non-OSX site):
>
> #!/bin/bash
>
> ## NOTE: ADD 'n' TO THE cmd OPTIONS WHEN TESTING
>
> dc=`date +%m%d%y`
> file='/Users/Charles/Documents/backup.log.'$dc'.txt'
> cmd='rsync -uvrtp --delete-after'
> src=/Users/Charles
> dest=/Users/charles/mnt
>
> # Is the volume mounted
> if mount | grep "moe:/backup"; then
> :
> else
> mount -t nfs moe:/backup $dest > /dev/null 2>&1
> rc=$?
> fi
>
> if mount | grep "moe:/backup"; then
> :
> else
> echo "Backup vol not mounted and mount attempt failed with $rc"
> >> $file
> mail -s "Weekly Backup results" charles < $file
> exit
> fi
>
> ...
>
Excellent solution! Brian was also correct that "$?" was being reset.
Thank you both.
Now...does anyone have any comment on the second issue?
Is it enough to just backup ~/Library/Application Support/Firefox/,
AddressBook/, iCal/, and ~/Library/Mail/, or should I use those
application's Export/Backup feature to generate the files I want to
backup?
More information about the X-Unix
mailing list