Posted on 09-08-2016 09:39 AM
Specifically, I would like a machine to restart (regardless of who is connected) every Friday at 6:00 PM. Can anyone help me with this?
Solved! Go to Solution.
Posted on 09-08-2016 11:21 AM
I do something similar to this to restart some electronic signs each night.
The script below will set the computer to restart every Friday at 6:00pm
#!/bin/bash
pmset repeat restart F 18:00:00
pmset -g sched
will show you any presently set power schedules
pmset repeat cancel
will cancel the repeating restart/shutdown/wake, etc.
Posted on 09-08-2016 11:54 AM
I take that back, I've set it up and will check out the results. Thanks!
Posted on 09-08-2016 09:48 AM
A LaunchDaemon using a CalendarStartInterval for every Friday at 6 PM that just calls a /sbin/shutdown -r now
command would do it.
Posted on 09-08-2016 11:19 AM
Pardon my ignorance but, I'm not familiar on how to do that.
Posted on 09-08-2016 11:21 AM
I do something similar to this to restart some electronic signs each night.
The script below will set the computer to restart every Friday at 6:00pm
#!/bin/bash
pmset repeat restart F 18:00:00
pmset -g sched
will show you any presently set power schedules
pmset repeat cancel
will cancel the repeating restart/shutdown/wake, etc.
Posted on 09-08-2016 11:42 AM
Yep, forgot about pmset. Good thought @Berrier! Probably easier than with a LaunchDaemon.
Posted on 09-08-2016 11:54 AM
I take that back, I've set it up and will check out the results. Thanks!
Posted on 09-08-2016 12:34 PM
I haven't had occasion to use it since 10.6, but
pmset repeat restart
did not force a restart, so a logged in user with modified documents would result in the Mac not restarting. You're better off with the
shutdown -r now
approach if that will be a problem.
Posted on 12-09-2016 06:45 AM
Is there anyway to disable the "Cancel" button that pops up for the user? I have no issue with them seeing a countdown and being able to click the "Restart" button, but I would prefer they don't cancel it.
Also, is there a way to set a time at which the pop-up shows up? If I want it to show up 1hr before the restart or 4hrs before a restart, is that possible?
Posted on 12-09-2016 11:46 AM
I've done this via Sys Pre, Energy Saver, Schedule. Made the changes on a VM while using the vm/computer to make a settings pkg with composer. Then pushed the pkg out to the computers that needed the settings updated. You'll have a few ways to do this.