Cara Reboot Otomatis Server Linux Ubuntu | How can I schedule a nightly reboot?


Cara Reboot Otomatis Server Linux Ubuntu | How can I schedule a nightly reboot?

open the terminal (ctrl+T)
sudo nano /etc/crontab
scroll all the way to the bottom and enter the below command
00 6 * * * root reboot
CTRL+O  CTRL+X
this is set for reboot at 6am everyday, and press enter
If you want to schedule poweroff at 11pm everyday you can enter
00 23 * * * root poweroff
CTRL+O  CTRL+X


----------------------------------

sudo crontab -e

The first time you might have to choose your preferred editor (like nano)
Insert a line like
0 4   *   *   *    /sbin/shutdown -r +5
at the bottom. Explanation:
m      h    dom        mon   dow       command
minute hour dayOfMonth Month dayOfWeek commandToRun
so the line
  0 4   *   *   *    /sbin/shutdown -r +5
would reboot your system every day at 4:05am. (4:00am + 5 minutes)
Ctrl+X, Y, Enter should get you out of crontab (if using nano)


0 Response to " Cara Reboot Otomatis Server Linux Ubuntu | How can I schedule a nightly reboot?"

Post a Comment