Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Any Other Scripts Available?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Any Other Scripts Available?
Authored by: gatorparrots on Mar 10, '03 06:07:59PM

#This script will back up your Entourage mail database to a CD
username="`who | grep console | awk '{print $1}'`"
if [ "$username" = "" ]; then
echo "No one logged in via GUI (console)" >&2
exit 1
userhome="`eval echo ~$username`"
date=`date +%Y.%m.%d`
size=`/usr/local/bin/du -sh "$userhome/Documents/Microsoft User Data" | awk ' { print $1 } '`

#Quit Entourage and give it time to write its database to disk
/usr/bin/osascript -l AppleScript -e 'tell Application "Microsoft Entourage" to quit'
/bin/sleep 4

/usr/bin/hdiutil create -fs HFS+ -volname Backup-$date -size $size "$userhome/Desktop/backup.dmg"
/usr/bin/hdiutil mount "$username/Desktop/backup.dmg"
/usr/sbin/disktool -r
echo $date >> /Volumes/Backup-$date/backup.log
/usr/bin/ditto -rsrc -V "$userhome/Documents/Microsoft User Data/Office X Identities/Main Identity/"\
/Volumes/Backup-$date/ >> /Volumes/Backup-$date/backup.log
/usr/bin/hdiutil unmount /Volumes/Backup-$date

#a reminder for those with slot loading drives:
/usr/bin/osascript -l AppleScript -e 'tell Application "Finder" to activate & say "Please insert a blank CDR disc."'
/usr/bin/hdiutil burn "/Users/$username/Desktop/backup.dmg" -noverifyburn -noeject

#Clean up and relaunch Entourage
/bin/rm "$userhome/Desktop/backup.dmg"
/usr/sbin/disktool -r
/usr/bin/osascript -l AppleScript -e 'launch Application "Microsoft Entourage"'

[ Reply to This | # ]
Any Other Scripts Available?
Authored by: jasenko on Mar 10, '03 06:11:53PM

Thanks, this is great script, I will adapt it to better suit my needs. I don't have cd burner on my Mac so I have to transfer the dmg to PC first.

[ Reply to This | # ]