Web Hosting Talk







View Full Version : Reboot raq using crontab


Shepski
07-02-2002, 05:02 AM
Hi

I am having a problem with my RaQ4 which my hosts are looking into but the guy who is dealing with it has now gone off on holiday! :(

Basically, the machine falls over at just after 5am in the morning, something to do with the logs rotating but the OS is not doing it correctly or something, anyway, until he gets back from holiday I need to be able to run a crontab at 5am every morning which will reboot the whole machine, not just the http. I think I know how to do the crontab but dont know the command for rebooting the machine. Can someone let me know what it would be?

Thanks

Shepski

infinite
07-02-2002, 05:44 AM
Hi,

you could use shutdown -r now for a graceful reboot, where programs and connections are given time to shutdown, or init 6 for a forceful reboot.

Of course a reboot won't stop the problem of the log rotation thing, why not just stop the logs rotating until your friend gets back? and if the box has hung completly, then the crontab may not run anyway.

HTH,
Infinite :)

CobaltCuban
07-02-2002, 09:07 AM
crontab -e
then add a new line (press O)
write this:
0 5 * * * /sbin/reboot

then ESC ESC
then :wq

Joey
07-02-2002, 10:58 AM
Ouch, seems like a rough way around the problem, but if that's what it's got to do until he gets back.

Might want to have him take a look at that while he's on vacation if he's got internet access. Shouldn't take more than maybe 30 minutes or diggin' through logs.

cobalt-serve
07-30-2002, 01:00 AM
This will not work cos you need to run it has root
Originally posted by Joey
Ouch, seems like a rough way around the problem, but if that's what it's got to do until he gets back.

Might want to have him take a look at that while he's on vacation if he's got internet access. Shouldn't take more than maybe 30 minutes or diggin' through logs.

Shepski
07-30-2002, 04:27 AM
It worked fine :)

Just to let you know the problem was in the log rotating. one site had a 1gb logfile that crashed the machine everytime it tried to compress it. The customer never bothers looking at there stats from the log files so we just delete them :)