From: Josh F. <jf...@pv...> - 2014-01-29 14:15:30
|
On 1/28/2014 10:22 AM, Joe Rhodes wrote: > Well, as it turns out, there’s an slightly better way to do this, at least for now. > > >> I see. With 10.7 and earlier there is no way to "temporarily" adjust the >> sleep timer. If a permanent long sleep timer is not desired, then it >> would require the RunBefore script to set the sleep timer with pmset and >> a RunAfter job to set it back to normal following the backup. My Mac >> clients are in and out of the office seemingly at random. It is not >> uncommon for the users to leave in the middle of a backup. Up grading to >> 10.8 and using caffeinate seems to be my best option, else they will be >> left with a long sleep timer while traveling should they leave in the >> middle of a backup. It is a real pain trying to backup these "road >> warrior" clients. >> > There’s an option to pmset called “noidle” that will keep the mac awake as long as the command is running. It runs in the foreground. So here’s what I do: > > Client Run Before Job = "bash -c \"/usr/bin/pmset noidle &> /dev/null < /dev/null &\"" > Client Run After Job = "/usr/bin/killall pmset" > > > The first command will run pmset with the “noidle” option in the background. This will keep the Mac awake. The second one goes through and kills the pmset command after the backup is done, thus allowing it to fall asleep per it’s schedule. > > That should take care of it for any recent OS X client, including 10.6 and up. Not sure about 10.5 and earlier. It should also handle backup jobs of arbitrary time. > > Also, if your Macs leave in the middle of a backup operation, they’ll have that running. A restart will correct that. So perhaps the “caffeinate” command is better for those folks. At least that will expire on it’s own. > > Note that the “noidle” option is deprecated as of 10.8 or 10.9 and Apple officially recommends using caffeinate instead. So we might have to rethink this sometime with the next release of OS X. > > > Sorry for all the back and forth on this. It’s something I’ve been wrestling with for a while. I think this will be my final answer. :) Thanks much Joe. Very useful info. |