LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-14-2011, 02:10 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
How to turn off the system automatically ?


Hi,
I am using Cent Os 5. I want that the system should shutdown automatically at 7:00 pm daily and next day I manually turn on the system.I have google it but the syntax is not clear.

I use # crontab -e
and write the command
0 19 * * * /sbin/shutdown -h now


I does't apply the command but please guide me that what is * * * after 19
Kindly guide me how can I enable this feature?
thanks in advance,
garden

Last edited by gardenair; 03-14-2011 at 02:33 AM.
 
Old 03-14-2011, 02:30 AM   #2
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
Scheduling a "shutdown -h now" via a cron job (for root user) that runs at 7.00 PM daily would do that.

Edit the crontab and add the following line
# crontab -e
Code:
  0 19 * * * /sbin/shutdown -h now
Check the man page for crontab (5) for more details.
 
Old 03-14-2011, 02:36 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks "vishnu_sreekumar" for the reply. Well what does * * * means ?
If I want to do it at 7:15 PM then how will it write ?
thanks for guiding me
garden
 
Old 03-14-2011, 03:30 AM   #4
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 173Reputation: 173
Quote:
If I want to do it at 7:15 PM then how will it write ?
15 19 * * * /sbin/shutdown -h now
 
Old 03-14-2011, 03:42 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
I would suggest to take a look at
http://en.wikipedia.org/wiki/Cron

Kind regards

Last edited by repo; 03-14-2011 at 03:47 AM.
 
Old 03-21-2011, 02:07 AM   #6
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
Quote:
Originally Posted by gardenair View Post
thanks "vishnu_sreekumar" for the reply. Well what does * * * means ?
If I want to do it at 7:15 PM then how will it write ?
thanks for guiding me
garden
Assume that you went through the wiki page and found the answer
 
1 members found this post helpful.
  


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
Turn off touchpad automatically Lunar_Lamp Linux - Laptop and Netbook 1 06-15-2006 09:22 PM
Power Wont turn off automatically marigb Linux - Hardware 5 11-16-2005 09:08 PM
turn off LCD automatically when idle? houler Slackware 18 04-24-2005 04:02 PM
pc couldn't turn off automatically after halting linux. horeddy Mandriva 4 02-01-2005 12:58 AM
how to turn numlock on automatically? Alf829 Linux - Newbie 6 08-22-2003 09:15 AM


All times are GMT -5. The time now is 12:13 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