⏰ 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.
- Check Server Time:
- Open a terminal and log in.
- Execute the
datecommand 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
timedatectlorntpd.
For Example: sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS' or ensure your ntp client is running.
- Calculate the Time Difference:
- Current time: (Obtain from the
datecommand 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.
- Schedule the Reboot:
- Log in as root or use
sudo. - Execute the
shutdowncommand, 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.
- Cancel the Reboot (if needed):
- To cancel the scheduled reboot, execute
shutdown -c.
Updated on: 10/12/2025
Thank you!
