I'd like to be able to schedule a server reboot at a specific time, but not regularly. How can I do this without futzing with adding and removing cron entries?
I'd like to be able to schedule a server reboot at a specific time, but not regularly. How can I do this without futzing with adding and removing cron entries?
If it is one-time deal, you can use shutdown command with -r as argument. Instead of using shutdown now, you can add time as parameter (e.g.
shutdown -r 12:30
).According to the man page: /sbin/shutdown [-t sec] [-arkhncfFHP] time [warning-message] found at --> http://unixhelp.ed.ac.uk/CGI/man-cgi?shutdown+8
Load of options to choose from but, to answer your question.
To reboot in 5 minutes: /sbin/shutdown -r 5 "reboot in five minutes"
To reboot at exactly 11:00 P.M.: /sbin/shutdown -r 23:00 "rebooting at 11:00 P.M."
NOTE: your message will be broadcast to all active terminals / sessions.
the
at
command is what you want.at -l
will list the at cmdsThe easiest way I can think of is:
Run this as root.
....