LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-14-2011, 01:03 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
"crontab" to start the system automatically.


hi,
I am using Cent OS 5 for squid server. At night 8:00 pm the system turn off automatically by using schedual i.e "crontab" command .

I want that the system should Turn ON automatically at 9:00 am.

Is there any way crontab command ? or other procedure so that i may not manually on the system

thanks
gardenair
 
Old 10-14-2011, 01:29 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,678

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
AFAIK there are basically two methods to automatically turn on a computer. The BIOS if it has a wake up alarm function or with another computer using WOL.
 
Old 10-14-2011, 01:41 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

I'm not sure you can do that from within the system itself. If the server is turned off, there's no way it can start up by itself in my opinion. There might be an option available in your BIOS to boot the server automatically at a programmed time, but that depends on your BIOS so check there. Another option is to put your server in hibernate mode and use a script from another computer to boot it IF your NIC supports Wake on Lan (WOL).

Kind regards,

Eric
 
Old 10-14-2011, 02:19 AM   #4
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Thanks for your replies. "EricTRA" as you mentioned

Code:
"Another option is to put your server in hibernate mode and use a script from another computer to boot it IF your NIC supports Wake on Lan (WOL)."
Here two things i want to clear. How to push my server in hibernate mode which i use crontab command ?

2-How can i check that my Lan card has Wake on Lan feature or not.Can we say that a Lan card which can boot over lan is called "Wake on Lan " ?

thanks ,
gardenair
 
Old 10-14-2011, 02:29 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You can use the commands from the pm-utils package:
Code:
pm-hibernate
to hibernate your system. In hibernation mode the system doesn't need power since the state is saved to disk.

To check if your NIC supports WOL run ethtool:
Code:
ethtool <yournic>
The output will look similar to:
Code:
eric@ericvs-laptop ~ $ sudo ethtool eth1
Settings for eth1:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Speed: 100Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: Unknown
	Supports Wake-on: pg
	Wake-on: g
	Current message level: 0x000000ff (255)
			       drv probe link timer ifdown ifup rx_err tx_err
	Link detected: yes
Where it shows Supports Wake-on, the letters indicate what your NIC supports, g means MagicPacket support.

Kind regards,

Eric
 
Old 10-14-2011, 02:40 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,678

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
In addition the BIOS must be set to allow WOL. There might be other settings to allow wake on LAN from standby or hibernate modes.

Booting from a LAN (PXE) is not the same thing as wake on LAN (WOL)
 
1 members found this post helpful.
Old 10-14-2011, 03:15 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks "EricTRA" for guiding. I want to clear my pactuere. I am using "crontab -e" and the script i am using is

Code:
00  20 * * * /sbin/shutdown -h now
The system shoutdown at 8:00 pm with the above command.

Again there are questions in my mind

1- After the execution of "crontab -e" coomand how the command how can the hibernation will work ?


2- Kindly guide me that what is pm-utils package from where i may download it ?


3- when i use teh command "ethtool eth0 it show me the following output

Code:
[root@my-proxy ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: umbg
        Wake-on: g
        Current message level: 0x00000007 (7)
        Link detected: yes
[root@my-proxy ~]#
Kindly check that is my eth0 support "wake on LAN " ?

thanks
gardenair
 
Old 10-14-2011, 06:57 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

1. If you shutdown your system completely with the command in your crontab then you are not in hibernation but a complete shutdown. Your wake on lan will work but will take significantly longer then when recovering from hibernation or suspend. If you want to use the hibernation method in order to start up faster, then you'll need the pm-utils package.
2. The pm-utils package can be installed using your package manager. In CentOS:
Code:
yum install pm-utils
3. From the ethtool output you posted:
Code:
Supports Wake-on: umbg
indicates your NIC supports Wake-on-Lan. The line:
Code:
Wake-on: g
indicates it's currently configured to use MagicPacket for triggering the 'wake up'.

Kind regards,

Eric
 
Old 10-14-2011, 12:42 PM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
I am so much thankful "EricTRA" for your help.Now the question is how to hibernate my system.After installing "yum install pm-utils " it will available ?

2- Using "crontab -e"how can I add my system into hibernate mode ? I mean what will be the complete command that the system should hibernate at 8:00 pm ?

thanks
gardenair
 
Old 10-15-2011, 02:54 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Yes, after installing pm-utils you'll have the command pm-hibernate available to put your system in hibernation instead of completely turning off. That will result in faster booting when needed.

Instead of using your shutdown command in crontab, put the hibernate command in there to replace shutdown. Have a look at the man page once you installed the pm-utils package.

Kind regards,

Eric
 
  


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
[SOLVED] "/etc/init.d/apache2" start VS "apache2ctl start" with passenger module (ruby/rails) arond Linux - Server 1 12-13-2010 10:56 AM
Hi, I'm having problems to start up my system. It displays "LIL- "at startup Oluwaseye Linux - Newbie 7 12-19-2007 02:24 AM
My box freezes during start-up while "starting system logger" basse- Red Hat 1 05-03-2004 03:44 PM
all "start\system settings" wont launch anymore. demmylls Linux - General 0 03-12-2004 01:02 PM
how can i run "sh <file>" automatically when i start linux? kublador Linux - General 6 03-02-2003 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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