Results 1 to 8 of 8
I am brand new with Fedora and Linux in all. I use Macs and PCs in the past. Now I have two Fedora computers running together, I want to create ...
- 05-30-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 3
Shutdown Script
I am brand new with Fedora and Linux in all. I use Macs and PCs in the past. Now I have two Fedora computers running together, I want to create a script to shut both down at the same time. How do I do this, Say I wanted to have them both shut down by midnight every night. How would I go about doing this? I created a script for windows to do this, but that is completely different from Linux. I run the latest fedora, and no absolutely nothing about scripting in linux.
Thanks For any help
- 05-30-2010 #2Just Joined!
- Join Date
- May 2010
- Posts
- 10
You can use crontab for auto task...
In your case. EXample use crontab...
59 23 * * * /sbin/shutdown -h now
Mean:
at 23h59min, all days of month, all month of year and all day of week
Your system will auto shutdown...
Best regard...
- 05-31-2010 #3Just Joined!
- Join Date
- Dec 2006
- Posts
- 6
- 05-31-2010 #4Just Joined!
- Join Date
- May 2010
- Posts
- 10
OH,
I miss " "
Thanks Ramesh
- 05-31-2010 #5Just Joined!
- Join Date
- Feb 2009
- Posts
- 5
investigate cron
Jic you didn't - investigate cron and crontab. The previous replies gave you a very specific reply - and a good one. The general reply is that cron holds the key to the your question's answer.
- 06-07-2010 #6Just Joined!
- Join Date
- May 2010
- Posts
- 3
Thanks guys,
So I have looked into the crontab. I created the crontab by going into my terminal typing crontab -e and then it brings up what looks to me a vi screen. From here I type in what I want the crontab to do (what you guys gave me). so just
59 23 * * * /sbin/shutdown -h now (I tried with and with out quotations)
Then I hold shift + ZZ to save and exit, it then goes back to the terminal and says
crontab: installing new crontab
But then it never executes. my computer never shuts down. If I type crontab -l to see what I have it shows
59 23 * * * /sbin/shutdown -h now ....so it is there
What am I doing wrong?
Thanks for everything so far
- 06-07-2010 #7Just Joined!
- Join Date
- May 2010
- Posts
- 10
Hi Beencountry,
You type following command and test it again:
---- Note: " "59 23 * * * "/sbin/shutdown -h now"
Good luck !
- 06-09-2010 #8Just Joined!
- Join Date
- May 2010
- Posts
- 3
Sorry I don't mean to seem like a pain, But Yea I copied and pasted that, and it still didn't work. I got to be doing something wrong I'm not sure, Is there maybe a script I can write that will do this? A script that will either create the crontab or one that will just simply shut down the computer?


Reply With Quote
