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


Click here to return to the 'Time Machine: Mount backup disk on demand' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Time Machine: Mount backup disk on demand
Authored by: jpkelly on Jul 21, '10 09:57:04PM
I use an AppleScript in conjunction with backupd-helper to accomplish this. I set the script to run via a launchd item every 3 hours using Lingon Works pretty well for me. Here is the Applescript:

tell application "Finder" to if not (disk "BACKUP" exists) then do shell script "diskutil mount " & last word of (do shell script "diskutil list | grep 'Apple_HFS BACKUP'")
delay 5

do shell script "/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper > /dev/null 2>&1  &"

repeat
	delay 10
	if not IsProcRunning("backupd") then
		ignoring application responses
			--tell application "loginwindow" to «event aevtshut»
			do shell script "diskutil eject " & last word of (do shell script "diskutil list | grep 'Apple_HFS BACKUP'")
			--display dialog "backup done"
		end ignoring
		exit repeat
	end if
end repeat

on IsProcRunning(theProc)
	try
		do shell script "ps auxc | grep \"" & theProc & "\""
		return true
	on error
		return false
	end try
end IsProcRunning
I also have an AppleScript in my startup items to unmount the drive after system startup:

on run
	delay 60
	ignoring application responses
		--tell application "loginwindow" to «event aevtshut»
		do shell script "diskutil eject " & last word of (do shell script "diskutil list | grep 'Apple_HFS BACKUP'")
		--display dialog "backup done"
	end ignoring
end run


[ Reply to This | # ]