Results 1 to 5 of 5
I just started working with shell scripts & crontab. A tutorial for shell scripts was very useful. Another fro Cron jobs seems equally simple & straight forward, but I must ...
- 06-18-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 3
Help with Crontab
I just started working with shell scripts & crontab. A tutorial for shell scripts was very useful. Another fro Cron jobs seems equally simple & straight forward, but I must be missing something obvious.
Basically, my crontab looks like this. I want the computer to reboot at 3:35 PM daily. However, when the time comes, it doesn't actually reboot. Or do anything else. When I set it to a path of a shell (IE /etc/cron.d/shutdown.sh) it also does not do anything.
Can someone tell me what I missed?Code:# m h dom mon dow command 35 15 * * * sudo shutdown -r 0
- 06-18-2010 #2Just Joined!
- Join Date
- Jun 2010
- Posts
- 3
I just saw the e-mail that is sent to /var/mail/zoneminder. It says
I guess in the case of rebooting the server, I need to create a shell script & pass it the password on the next line? It seems a little unsafe!Code:[sudo] password for zoneminder:
- 06-19-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 3
Bump
Bumpety bump bump
- 06-19-2010 #4Just Joined!
- Join Date
- Jun 2010
- Posts
- 1
push ur ssh keys to /root/.ssh
ssh root@localhost "shutdown -r 0"
- 06-19-2010 #5
To run a root level crontab you must edit the root users crontab
run
and add your command in thereCode:sudo crontab -e
You may need to addCode:# m h dom mon dow command 35 15 * * * shutdown -r 0
as the first line in the crontab file.Code:PATH=/usr/sbin:/usr/bin:/sbin:/bin
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.


Reply With Quote