How can I schedule an automatic reboot of my server with CentOS via terminal or via plesk every 12 hours?
1 Answer
Add the following to root's crontab:
0 0,12 * * * /sbin/init 6
But honestly, why on God's green earth would you want to reboot every 12 hours?
-
-
also reboot or shutdown -r would work as well in that cron job, but i echo @ErikA's point, why do you want to reboot every 12 hours May 31, 2011 at 21:12
-
I have a problem on my server and i can't fix them in this week so i need to reboot it every 12 hour to save it from crash. How can I add this line? I run this command crontab -e and I get a list of all the scheduled process, how can I add the line that erikA suggest to me? Thanks May 31, 2011 at 21:15
-
@paul - there are many questions on SF about adding cron jobs. Just search for one and you'll find the information you're looking for.– EEAAMay 31, 2011 at 21:24
-
I run crontab -e and I simple add the line 0 0,12 * * * /sbin/init 6 then I save the file. Is everything ok? thanks May 31, 2011 at 21:50