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. :) Cheers! -Joe Rhodes >> >>> You wouldn't happen to know how to enable WoWLAN on a Mac would you? >> >> Again, easily set in System Preferences or using pmset from the command >> line. If you?ve got a lot of Macs, Apple Remote Desktop is your friend >> here. (?Send Unix Command? to the whole fleet) > > Thanks, Joe. > >> >> Cheers! >> -Joe Rhodes >> >> >>> For those that are backing up OS X clients, you may have noticed that 10.8 >>> Mountain Lion and later is much more militant about having machines sleep. >>> Even if you issue a WOL packet to start a backup, they still fall back >>> asleep pretty quickly unless there?s someone actually using the mouse and >>> keyboard. It doesn?t really matter what you have the sleep timer set to. >>> >>> Apple?s strategy seems to be that programs that need to run must issue a >>> ?power assertion? to the system, indicating that the system must stay awake >>> for them complete their task. Fortunately, it?s easy enough to issue one >>> of these manually using the command line. >>> >>> In my job definition (in the Bacula director configuration) I?ve added >>> this line to my Mac clients: >>> >>> Client Run Before Job = "/usr/bin/screen -d -m /usr/bin/caffeinate -i -t >>> 3600; sleep 0;? >>> >>> The first part, using the ?screen? command, puts the command in the >>> background. The ?caffeinate? command is new for 10.8 and later, and will >>> keep the system awake for 3600 seconds. (Edit to suit your needs.) >>> >>> If you?re backing up 10.7 or earlier systems, they won?t have the >>> caffeinate command, so trying to issue it will fail and thus your backup >>> would fail. That?s why there?s the ?sleep 0? part at the end. It ensures >>> you?ll always exit this command with a success (0). >>> >>> Hopefully this will help someone else that gets stuck when a Mac backup >>> starts but then fails, usually taking about 2 hours before the director >>> will give up and move on. >>> >>> Windows 7 seems to have a similar issue. I was able to solve that by >>> editing a registry value as below: >>> >>> >>> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e] >>> "AcSettingIndex"=dword:00000e10 >>> >>> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c] >>> "AcSettingIndex"=dword:00000e10 >>> >>> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\a1841308-3541-4fab-bc81-f71556f20b4a] >>> "AcSettingIndex"=dword:00000e10 >>> >>> Cheers! >>> -Joe Rhodes
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users