LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2010, 01:52 PM   #1
zensunni
Member
 
Registered: Feb 2008
Posts: 45

Rep: Reputation: 0
Ubuntu Automatic shutdown 10.04


For some reason I couldn't get this to work:
http://www.liberiangeek.net/2010/06/...04-lucid-lynx/

I followed the instructions to the letter. Not sure what I'm doing wrong...

I've tried:
-rebooting before scheduled task time
-scheduling simple tasks (gedit), which does not work
-"shutdown -h now" (found that "/sbin/shutdown" didn't even work on terminal)
-scheduling a "One-time task" (I've confirmed this works, but I need a recurring task)

I've confirmed that the "shutdown -h now" task works when I click the "run selected task" button.

But every time the clock rolls on top of the scheduled task time, it just sits there and does nothing. This is infuriating.

Does there have to be a certain amount of time between when you set a task and when it will run?

I'm using ubuntu 10.04 as article says.

[Edit] I've figured it out. I used "/sbin/shutdown -h now".

So, my question now is: why did "/sbin/shutdown -h now" work, when "shutdown -h now" didn't?
They both work in the terminal. Why won't "shutdown -h now" work when the app is running it?

Last edited by zensunni; 11-04-2010 at 02:55 PM.
 
Old 11-04-2010, 02:56 PM   #2
SonnySee
Member
 
Registered: Aug 2010
Distribution: Unbuntu 11.10 beta
Posts: 78

Rep: Reputation: 10
While it may not provide the answer to what is going wrong with your cron job, if all you are trying to do is schedule an automatic shutdown, try the program gshutdown.
You can find it in the software center, or if you prefer you can enter this in the command line:
sudo apt-get install gshutdown

According to the software's website :"GShutdown is an advanced shutdown utility which allows you to schedule the shutdown or the restart of your computer, or logout your actual session."

If you are really set on discovering what the problem is with your current setup, perhaps this link will help: https://help.ubuntu.com/community/CronHowto

There is a section that gives instructions on troubleshooting problems with cron jobs.

Hope this helps.

Cheers

Last edited by SonnySee; 11-04-2010 at 03:00 PM.
 
1 members found this post helpful.
Old 11-04-2010, 03:00 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
So, my question now is: why did "/sbin/shutdown -h now" work, when "shutdown -h now" didn't?
They both work in the terminal. Why won't "shutdown -h now" work when the app is running it?
Because CRON has a limited PATH
It's always a good idea to use the full PATH to commands and files when you use CRON

Kind regards
 
Old 11-04-2010, 09:14 PM   #4
zensunni
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 0
Thanks repo, sonnysee.

I was able to get it working.

Now that I have my shutdown, I just need to get xmessage working with cron to give me a warning message.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can I time an automatic shutdown? newbiesforever Linux - General 10 01-04-2009 11:24 AM
automatic shutdown muhammednavas Fedora 1 12-01-2006 11:48 AM
Automatic system shutdown chobin SUSE / openSUSE 2 06-05-2006 09:51 AM
Automatic shutdown using ping amelieo Linux - Networking 4 04-24-2004 05:59 AM
Automatic shutdown NetScripter Linux - General 1 10-17-2002 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration