Articles on: ggRock

⏰ Scheduling a Reboot in Advance on Debian Linux (Using shutdown)

To schedule a reboot for 5:30 PM today (based on the number of minutes from now), with a time check, follow these steps.


  1. Check Server Time:


  • Open a terminal and log in.
  • Execute the date command to display the current date and time:


root@ggRock:~# date
Thu 13 Mar 12:56:36 GMT 2025


  • Verify that the displayed time and date are accurate. If they are not, adjust the server's time using timedatectl or ntpd.

For Example: sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS' or ensure your ntp client is running.


  1. Calculate the Time Difference:


  • Current time: (Obtain from the date command output)
  • Desired reboot time: 5:30 PM
  • Time difference: Calculate the difference in hours and minutes, then convert it to total minutes.
  • For example, if the current time is 1:00 PM, the time difference would be 4 hours and 30 minutes, or 270 minutes.


  1. Schedule the Reboot:


  • Log in as root or use sudo.
  • Execute the shutdown command, replacing [minutes] with your calculated time difference:
  • Example (using the previous calculation of 270 minutes):


root@MediaCityGG:~# shutdown -r +270
Reboot scheduled for Thu 2025-03-13 17:31:35 GMT, use 'shutdown -c' to cancel.


  1. Cancel the Reboot (if needed):


  • To cancel the scheduled reboot, execute shutdown -c.


Important Considerations:Time Accuracy: The date command check is crucial. If the server's time is incorrect, the reboot will occur at the wrong time, potentially causing significant disruptions.Minute Calculation: Double-check your minute calculation to ensure accuracy.Shut down all machines: Ensure all machines are shut down before the server reboot to avoid an I/O storm.

Updated on: 10/12/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!