Scheduling a Shutdown or Reboot on Linux servers

Scheduling a Shutdown or Reboot on Linux servers

Use the following commands to shutdown and reboot Linux form a terminal.

Shutdown a Linux server

shutdown -h now

Reboot a Linux server

shutdown -r now

Schedule a Reboot

For Reboot:

echo "/sbin/shutdown -r now" |at 04:00 tomorrow

For Shutdown:

echo "/sbin/shutdown -h now" |at 04:00 tomorrow

Schedule Examples

at 21:00 today
at 21:00 tomorrow
at 21:00 tuesday
at 21:00 July 11 (Month Day)

To check the schedule run

atq