Created
October 8, 2013 16:42
Revisions
-
pjv created this gist
Oct 8, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version="1.0"> <dict> <key>Label</key> <string>mac.backup</string> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>3600</integer> <key>Program</key> <string>/path/to/tm_backup.sh</string> </dict> </plist> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/bash # This is the name of your backup disk BACKUP_DISK="Backup" # Mount the disk if it is unmounted if ! mount | grep "$BACKUP_DISK" ; then diskutil mount "$BACKUP_DISK" fi # If the drive is successfully mounted, do the backup (nothing will happen if disk is not connected) if mount | grep "$BACKUP_DISK" ; then # do backup, then unmount backup volume tmutil startbackup --auto --block && diskutil eject "$BACKUP_DISK" fi