Reboot VPS Everyday using Cron

Linux Server Management Tips and Tricks
Post Reply
arnlweb
Site Admin
Posts: 95
Joined: Wed Jun 22, 2016 1:28 pm
Location: India
Contact:

Reboot VPS Everyday using Cron

Post by arnlweb » Mon Jan 09, 2017 9:47 am

How to reboot VPS server everyday using cron?

Edit crontab:

Code: Select all

sudo crontab -e
Choose an editor (like nano), if you are doing this first time.

Insert a line like at end of the cron file

Code: Select all

0 3   *   *   *    /sbin/shutdown -r +5
Explanation:
Minute(0) Hour(3) DayOfMonth(*) Month(*) DayOfWeek(*) CommandToRun(/sbin/shutdown -r +5)

It would reboot your VPS server everyday at 3:05am. (3:00am + 5 minutes)

Post Reply