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

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" <>
To: "Philadelphia Linux User's Group Discussion List" <>
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 <> 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 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         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

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         --
Announcements -
General Discussion  --