Results 1 to 3 of 3
I wrote a script that should reboot my system every hour. I put the script in the cron.hourly folder yet it doesn't seem to work. The other scripts in cron.hourly ...
- 09-28-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 15
how do I get cron to reboot my system?
I wrote a script that should reboot my system every hour. I put the script in the cron.hourly folder yet it doesn't seem to work. The other scripts in cron.hourly do work.
i used nano to create the script and i used chmod 0775 to make the script executable. when i ./script it works fine. root is the owner of the script.
the contents of the script are as follows:
shutdown -h now
Does anyone know what I am missing?
I want this system to reboot every hour. I know that sounds strange but its necessary here.
- 09-28-2007 #2
PATH problem. Build the PATH up appropriately or use the FQ name:
/sbin/shutdown
Also, you might want to review the manpages for shutdown( 8 ). Using the -h option is not going to reboot your box.
May I ask why? There is almost certainly a better solution.
Originally Posted by dwygant
- 09-28-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 15
Ah yes, the PATH... ok i think that did it. Thanks very much.
Yes, the -h, of course. I actually want the system to shutdown and stay down until I bring it up manually.
Do you know if I need a #!/bin/sh as the first line in my script?


Reply With Quote