Re: Detecting if Time Machine is busy backing up
Re: Detecting if Time Machine is busy backing up
- Subject: Re: Detecting if Time Machine is busy backing up
- From: Wayne Melrose <email@hidden>
- Date: Tue, 11 Aug 2009 21:37:06 +0200
On 11. aug.. 2009, at 19.11, Laine Lee wrote:
On 5/7/09 2:25 PM, "rob" <email@hidden> wrote:
I'm writing a script to eject my Time Machine backup drive. I'd
like to
first determine whether Time Machine is in the middle of running a
backup,
and let it finish before ejecting.
Is there any info on scripting TM anywhere? If needed, maybe a way to
determine when the next backup is scheduled to take place?
_______________________________________________
The backup daemon process always quits within a few minutes of
completing a
Time Machine backup. I guess some buffer time is good. Sorry this is
so
late.
if IsProcRunning("backupd") then
set app_is_up to true
else
set app_is_up to false
end if
if app_is_up then
display alert "TM is Running."
else
display alert "TM is not Running."
end if
on IsProcRunning(theProc)
try
do shell script "ps auxc | grep \"" & theProc & "\""
return true
on error
return false
end try
end IsProcRunning
--
Laine Lee
A quick syntax question, is there any reason why we need the extra
"if" handler?
can't we just use this
---------------
if IsProcRunning("backupd") then
display alert "TM is Running."
else
display alert "TM is not Running."
end if
on IsProcRunning(theProc)
try
do shell script "ps auxc | grep \"" & theProc & "\""
return true
on error
return false
end try
end IsProcRunning
---------------
OR
---------------
set blnTimeMachineActive to IsProcRunning("backupd")
if blnTimeMachineActive then
display alert "TM is Running."
else
display alert "TM is not Running."
end if
on IsProcRunning(theProc)
try
do shell script "ps auxc | grep \"" & theProc & "\""
return true
on error
return false
end try
end IsProcRunning
---------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden