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.
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.
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.
Cancel the Reboot (if needed):
To cancel the scheduled reboot, execute shutdown -c.