• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting if Time Machine is busy backing up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Detecting if Time Machine is busy backing up
      • From: Laine Lee <email@hidden>
References: 
 >Re: Detecting if Time Machine is busy backing up (From: Laine Lee <email@hidden>)

  • Prev by Date: Re: get type of selected finder item
  • Next by Date: Re: Detecting if Time Machine is busy backing up
  • Previous by thread: Re: Detecting if Time Machine is busy backing up
  • Next by thread: Re: Detecting if Time Machine is busy backing up
  • Index(es):
    • Date
    • Thread