Solved

CentOS 5.6 Schedule Auto Reboots

Posted on 2012-03-14
8
1,251 Views
Last Modified: 2012-04-02
How can i schedule a monthly reboot of a CentOS 5.6 server?
0
Comment
Question by:deklinm
8 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 125 total points
ID: 37721909
You could use cron as a root but it is not advisable.  It should be done manually.  But with cron you could do like, suppose on first of every month

* * 1 * * shutdown -r
0
 
LVL 77

Assisted Solution

by:arnold
arnold earned 125 total points
ID: 37723262
Depending on the reason, it might be better to schedule the service restart than the complete system, service restarts quicker to get the system back.

You could use anacron /etc/my.monthly ...
0
 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 125 total points
ID: 37761277
Cron is always a good option !!!!

0 0 1 * * /sbin/reboot

This will help you out.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 77

Expert Comment

by:arnold
ID: 37762072
A reboot could terminate cron and by extension the reboot leading to an unknown state of the system.
IMHO, it is a bad practice to schedule restarts of the entire system. You never know whether something unexpected occurs that could lead to data loss.
0
 
LVL 40

Assisted Solution

by:noci
noci earned 125 total points
ID: 37770257
@arnold, when you run reboot, it sends a state_6 to the init process.
The init starts tearing down the system and it doesn't matter if cron still runs or not.
(And the older reboot, just forces a reload of the system by jumping to the BIOS init code after entering realmode of the processor, so nothing is saved or can intervene)

Using anacron for his is not very wise, because anacron will also run programs that should have been run when the system was down [ catching up with pending work ]. It will reboot just after anacron starts if there was a pending reboot [ because it was turned of ].
0
 
LVL 77

Expert Comment

by:arnold
ID: 37770736
I think a permanent reboot schedule is not a good idea.
There has to be an underlying reason for this. IMHO, the issue if any that is leading to the reboot consideration should be addressed, resolved.
0
 
LVL 40

Expert Comment

by:noci
ID: 37770782
@arnold,
Ah but that wasn't the question..., and alas windows habits / necessities do creep out.
0
 
LVL 77

Expert Comment

by:arnold
ID: 37770834
Noci, farzanj provided an answer ( though the hour, minute should be set) to the question, I am commenting on the ... Of the consideration. I.e you run yum update, kernel updates are made, the system reboots by schedule but does not come up because of one thing or another.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
installing docker on ubuntu 6 36
How to mount nfs share on this CentOS server? 6 42
Intel fortran compiler (ifort) 5 38
Recover Lacie Edmini data. 11 54
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question