2

How can I schedule an automatic reboot of my server with CentOS via terminal or via plesk every 12 hours?

1 Answer 1

12

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?

8
  • init 6 is the same of reboot?
    – paul_1991
    May 31, 2011 at 21:10
  • 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
    – paul_1991
    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.
    – EEAA
    May 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
    – paul_1991
    May 31, 2011 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .