Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 12 down vote accepted

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?

share|improve this answer
    
init 6 is the same of reboot? –  paul_1991 May 31 '11 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 –  anthonysomerset May 31 '11 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 '11 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 '11 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 '11 at 21:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.