On 05/11/2014 08:05, Stefan Haller wrote:
> I have this LaunchAgent in ~/Library/LaunchAgents/ that fires once every
> night at 1am to trigger a backup. (I also configured my Energy Saver
> schedule to wake up the machine at 1 so that the job can run.) This has
> worked perfectly and super reliably for many months now.
>
> After upgrading to Yosemite this no longer works. On most days, the job
> doesn't run at all; on some days I have seen it trigger at random times,
> e.g. 16:12 (the machine was awake the whole day).
Has the previous run finished? If the program is still running then
launchd won't start another, but will wait for it to finish first. This
might explain a new backup starting at 16:12.
>
> The relevant section of the launchd plist is
>
> <key>StartCalendarInterval</key>
> <dict>
> <key>Hour</key>
> <integer>1</integer>
> <key>Minute</key>
> <integer>0</integer>
> </dict>
>
> For testing I have created a new plist which is an almost exact
> duplicate, with just a different Label, and calling a different Program;
> this triggered correctly at 1am.
You could delete the old one and re-create it, just in case. I assume
you have done this already?
Does the original have the right permissions? (But if they are wrong I
would have thought that it would never run.)
> Does anybody have experience with this? Any ideas how to trouble-shoot
> this?
Change the entry to launch a shell script that writes out the date and
time to a log file; then calls the backup program; then logs the date
and time again so you get exact times for when each invocation starts
and finishes.
Create a second entry that just calls (a copy of) the shell script that
logs but doesn't invoke the backup. This way you can see if launchd is
launching something at the right time, just not your program.
--
Bruce Horrocks
Surrey
England
(bruce at scorecrow dot com)