System reboot resets all processes, free up memory, remove temporary files, etc. It can reduce system loads. This tutorial shows how to schedule reboot regularly in Linux.
To reboot Linux system, the shutdown
command with -r
can be used. In order to schedule reboot regularly in Linux, a new cron job can be added in the /etc/crontab
file. Open it with text editor:
sudo nano /etc/crontab
For example, add the following cron job to reboot system every day at 3 AM:
0 3 * * * root shutdown -r
Cron fields:
* * * * *
| | | | |______day of week (0-6) (0 is Sunday)
| | | |________month (1-12)
| | |__________day of month (1-31)
| |____________hour (0-23)
|______________minute (0-59)
Leave a Comment
Cancel reply