LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 01:10 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
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 01:33 AM.
 
Old 03-14-2011, 01: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, 01:36 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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, 02:30 AM   #4
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
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, 02:42 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

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

Kind regards

Last edited by repo; 03-14-2011 at 02:47 AM.
 
Old 03-21-2011, 01: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



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

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

All times are GMT -5. The time now is 07:02 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
Open Source Consulting | Domain Registration