I want to make an app that notifies me when Time Machine has successfully & completed backed up my computer though a “display dialog” function maybe???
Thanks!
Benjamin
I want to make an app that notifies me when Time Machine has successfully & completed backed up my computer though a “display dialog” function maybe???
Thanks!
Benjamin
StefanK’s suggestion is good. However, if you wanted to do it yourself here’s an outline of what I think might work.
I think you could probably use launchd to detect when a backup started. Set the Time Machine folder as a watch folder. When a backup starts I believe launchd would see the change in the watch folder and run a script for you.
once the script starts you would have to disable the launchd plist so you don’t receive more notices.
do shell script "launchctl unload /path/to/plist
try -- error if the process isn't found
set theWords to words of (do shell script "/bin/ps -Aco command,%cpu | grep \"backupd\"")
set cpuUsage to (item 2 of theWords) as real
if cpuUsage is 0.0 then
display dialog "Finished!"
else
log "still running"
end if
on error
display dialog "Finished!"
end try
do shell script "launchctl load /path/to/plist
Ok, thanks guys. I’ll take a look at the time machine app and your code.
I appreciate all your help!!
distnotifications and look for backupd
otherwise youll hammer the system in a poll