Jump to content
RESET Forums (homeservershow.com)

Schedule Reboot


Dwain Pipe
 Share

Recommended Posts

I've got my Gen 8 running WHS 2011 currently.  Works like a dream. :-)

 

I've not used iLO before and not sure if that is the route to go...

 

I'd like to get my server to reboot on a regular basis, regardless of the OS receiving an update that needs a reboot.

 

Any ideas how I can do this?

 

Would it be via the OS (so it shuts down and restarts gracefully) or via iLO?

 

Thanks in advance.

 

Craig

Link to comment
Share on other sites

You can do it via the Windows Task Scheduler.

 

Alternately (which is similar), you can use the at command from the command line (recommended: run the command prompt as administrator) to create a scheduled task.

 

https://support.microsoft.com/en-us/kb/313565

 

If you look at the Microsoft syntax, you can schedule time.  The command-line command for a server shutdown or restart is shutdown, with a syntax like this:

 

shutdown -r -t 30

 

Where -r means reboot, and -t <number> means time, and the number of seconds (my above command would start a reboot countdown of thirty seconds).  You could use 0 for an immediate reboot, or 300 if you want a five minute reboot countdown, or set your own.

 

So if we add this to our "at" command, here's a basic example:

 

at 00:30 shutdown -r -t 60

 

This would set your server up to restart at the next 1:30AM (uses military time) plus sixty seconds.  This would be a one-time command, so we would need to add an additional step, like so:

 

at 00:30 /every:M,T,W,Th,F shutdown -r -t 60

 

This would case the server to restart every weekday at 1:30AM plus sixty seconds.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...