Alexander Kohr on 9 Nov 2015 15:34:02 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] cron/launchctl problems in MAC OS


With Launchd 
Your computer sleeping for 15 minutes sounds like it is definitely the problem. 

If you job could not run because the computer was asleep it will run when the computer wakes up.  If the machine is powered off it won't run until the next designated time frame. 
 info at https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html

If it really must run at the time you want it to run instead of when the computer is being used, Change your sleep settings using either the Energy Saver control panel or via pmset command line utility.  If it is a laptop you should probably only ever set it to not go to sleep when you are on Charger or UPS.  And/or you might invoke some scheduled start up or wake commands or sleep commands to occure slightly before and or well after your scheduled runs. 
 



___________
Alexander Kohr
Unix Systems Administrator
Fox Chase Cancer Center
Temple University Health System 
333 Cottman Ave
Philadelphia PA 19111
215-214-1667 (M,THu, Fri)
215-707-9321 (Tu,W)




On Nov 5, 2015, at 7:39 PM, Gregory Deal wrote:

Well the Mac is definitely set to sleep after 15 minutes. And when it does awake, like when I hit a key, it's back running within a minute. So could this still be causing tasks to start 20 minutes or more late? Thanks.


From: "Isaac Bennetch" <bennetch@gmail.com>
To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
Sent: Thursday, November 5, 2015 4:51:46 PM
Subject: Re: [PLUG] cron/launchctl problems in MAC OS



On Nov 5, 2015, at 3:16 PM, Gregory Deal <1deal@comcast.net> wrote:

I recently tried to switch over to launchctl on my Mac Mini (10.7.5) from cron on a PC. I searched and think I have things set up right, but it seems that the scheduled script starts significantly after the requested time. Details at http://stackoverflow.com/questions/32829026/using-launched-and-plist-starts-late. I would appreciate any guidance, insight, or things to try. Thanks.

Are you sure the Mac isn't going to sleep? If it does, IIRC the task will run when it wakes up. 

Also, unrelated to your apparent problem but a point of frustration for me that took a while to track down: if your job runs too quickly, launchctl doesn't like this and tries to restart it again immediately, causing...problems. 

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


CONFIDENTIALITY NOTICE: This email communication may contain private, confidential, or legally privileged information intended for the sole use of the designated and/or duly authorized recipient(s). If you are not the intended recipient or have received this email in error, please notify the sender immediately by email and permanently delete all copies of this email including all attachments without reading them. If you are the intended recipient, secure the contents in a manner that conforms to all applicable state and/or federal requirements related to privacy and confidentiality of such information.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug