[K12OSN] OT: Shutdown Linux from Windows?

Huck dhuckaby at paasda.org
Wed Sep 6 01:28:29 UTC 2006


That's killer...odd...but killer ;)
why would you have a 'turn on' time in the bios but not a 'turn off' 
time? that being said, why couldn't you have a cron job set to turn off 
the machine every Friday at 7pm for example? then have your BIOS 'turn 
on' Monday at 5am? if you are looking for weekend downtime?

Not sure of the reasoning for the 'remote shutdown' but seems a cron job 
would do the trick without the need to script anything.

/sbin/shutdown -h <time> Server Going Down, Save all work IMMEDIATELY!!!

where <time> can have different formats. First, it can be an absolute 
time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm 
is the minute of the hour (in two digits). Second, it can be in the 
format +m, in which m is the number of minutes to wait.

the paragraph above directly from the man page.

--Huck

Paul VanGundy wrote:
> Huck,
> 
> Check the BIOS. Some systems come with "Turn On" times now.
> 
> -Paul
> 
> 
> Huck wrote:
>> Kind of curious how you'll restart the remote linux machine after you
>> shut it down remotely...user intervention?
>>
>> --Huck
>>
>> Doug Simpson wrote:
>>> Here is a possibility. . .
>>>
>>> Ping the winders box (the one from which you want to shut down the
>>> linux server) and outputs to a file.
>>>
>>> example:
>>> [server]$ ping -i 5 servername >> /pingreturns
>>> This pings the server every 5 seconds. Change the number to whatever
>>> resolution you want.
>>> Run this fron a cron job at a time a bit after you expect the winders
>>> computer to be online, say half an hour after. (or you could put it
>>> in the rc.local so it will run when the server is started, just make
>>> sure the winders one is up enough to reply to ping requests or the
>>> linux will go back down again.)
>>> Run a second cron job that runs every minute (or whatever resolution
>>> you prefer) that
>>> greps this outut file for a string stating that the pinged hosts is
>>> unreachable:
>>>
>>> grep reply /pingreturns and if it finds "reply from" then exit.
>>>
>>> If it finds "unreachable" branch and delete the /pingreturns file
>>> and then run "shutdown -h now".
>>>
>>> The grep line is the one I will need help with the syntax and it may
>>> actually have to be done in a script that would run in the cron job.
>>>
>>> What this will do is ping the winders computer. If it returns, all is
>>> well. If it is unreachable, delete the /pingreturn file (so it won't
>>> try to use it tomorrow and find "unreachable" in there and shut right
>>> back down again) and then shutdown the linux computer with:
>>> shutdown -h now
>>> in the script.
>>>
>>> Assuming this is a daily thing, you will only need to shutdown the
>>> winders one and the linux will soon follow it based on your
>>> resolution as mentioned above.
>>>
>>> I will try to play with the grep thing later and see if I can come up
>>> with a workable solution for you.
>>>
>>> Hope this is what you were looking for.
>>>
>>> Doug
>>>
>>>
>>>
>>>
>>>
>>> Onatawahtaw wrote:
>>>
>>>> Greetings,
>>>>
>>>> Currently I can shut down all my windows computers
>>>> using psshutdown.exe (and a batch program). Is there
>>>> any way I can shut down linux computers from within
>>>> windows?
>>>> If not, how can I shutdown remote linux computers from
>>>> within linux? All the linux computers use the same
>>>> root password so I would like to just put them in a
>>>> shell script.
>>>>
>>>> Thanks,
>>>>
>>>> -Kevin
>>>>
>>>> __________________________________________________
>>>> Do You Yahoo!?
>>>> Tired of spam?  Yahoo! Mail has the best spam protection around
>>>> http://mail.yahoo.com
>>>> _______________________________________________
>>>> K12OSN mailing list
>>>> K12OSN at redhat.com
>>>> https://www.redhat.com/mailman/listinfo/k12osn
>>>> For more info see <http://www.k12os.org>
>>>>
>>>>  
>>>>
>>> _______________________________________________
>>> K12OSN mailing list
>>> K12OSN at redhat.com
>>> https://www.redhat.com/mailman/listinfo/k12osn
>>> For more info see <http://www.k12os.org>
>>>
>>>
>> _______________________________________________
>> K12OSN mailing list
>> K12OSN at redhat.com
>> https://www.redhat.com/mailman/listinfo/k12osn
>> For more info see <http://www.k12os.org>
>>
> 




More information about the K12OSN mailing list