Scheduled shutdown

Associate
Joined
18 Oct 2002
Posts
2,188
I have some machines at work that i need to schedule to shutdown at a certain time due to power being switched off to the building in the early hours.

Some machines are running mandriva 10 and others mandriva 2006.

Is it possible to shutdown the servers at a set time? for example 03:00?

I have looked on google and the best result i could find would be to use the following in the konsole:

/sbin/shutdown -r hh:mm

I tried this as well as just shutdown -r hh:mm, and i also tried replacing the -r for a -h but none of them worked.

Any ideas?
 
kiwi said:
sudo crontab -e -u root

add this:
0 03 * * * /sbin/shutdown -h now

voila.

I've tried running this but it didnt work. When i typed that into Konsole all i got was the following:

cron.jpg


I can't see how to enter it into there.

I also tried manually going into the /etc folder and editing the crontab file but it didnt do anything from there either.
 
if using a root terminal session, which it looks like, use cron -e instead.

no crontab for root - using an empty one

^^ this is what it says when you run it.
 
That's just the vi editor, press i (to enter insert mode) and type away.
Press esc, then type :wq when you want to save and close.

Or you can play around changing your default editor.
 
Back
Top Bottom