You are not logged in.
Pages: 1
I have been trying to schedule a shutdown, but it has not been working. I was testing it by adding to the crontab:
00 * * * * /sbin/shutdown -h -P
Which should have started a shutdown on the next o'clock.
It didn't.
My guess is that theres a config file somewhere that tells who can and who cannot run shutdown. Any ideas what it might be?
EDIT: DOH! Forgot to put on a time... Will try again...
Still didn't work. The new line was:
10 * * * * /sbin/shutdown -h -P -t secs now
Tried the command outside of cron, and it works. I was usind date to check the time, and 17:10 came and passed and still no shutdown. Any idea what's wrong?
Offline
If the crontab is not executed as root, you may be right that you have to define users that are allowed to shut the machine down.
I heard something about a /etc/shutdown.allow file. Maybe you should check man shutdown or something. (:
Hail to the thief!
Offline
Well, I just can ps -Af | grep cron, and it appears as though /usr/sbin/crond is run as root. I can't really see what could be wrong now...
Offline
if it's a one-shot use, you can try to use the at command. try "man at"
or use kshutdown...
what goes up must come down
Offline
This is a scheduled shutdown that i will want every weeknight, so a one time thing won't work
Hrmmm, must be an error in my task syntax. Set it to
* * * * * /sbin/shutdown -h -P -t secs now
And my box shutdown 10 seconds later.
LoL.
I'll have to take a look at this...
If I wanted my box to shut down at 11:30 every weeknight...
30 23 * * 2,3,4,5,6 /sbin/shutdown -h -P -t secs now
That would do it?
EDIT: I seem to be encountering some difficulties that my box shuts down 30 secs after it starts... Working to repair...
Offline
UGH. I really screwed myself over this time. Any idea how I can get around that cron job?
EDIT: got it! just logged in and really quickly ran a killall crond. Edited the crontab and rebooted cron.
Offline
That cron job format works like a charm. Thanks!
Offline
Pages: 1