Shutdown computers? [SOLVED]

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sat Sep 05, 2009 21:26    Post subject: Shutdown computers? [SOLVED] Reply with quote
Had some time today to play around with WOL and using it with cron. I can wake up a couple of pcs that I want to backup at midnight and now I would like to know if it is possible to shut them down at a certain time, kind of the reverse of WOL?

Thanks!
Very Happy

_________________
WRT1900AC v1-build r30731


Last edited by Slione on Mon Sep 07, 2009 12:06; edited 1 time in total
Sponsor
the.root
DD-WRT Novice


Joined: 10 Jul 2007
Posts: 10

PostPosted: Sat Sep 05, 2009 21:42    Post subject: Reply with quote
What OS are running on these machines? Could always make a script, using ssh commands to connect and poweroff *nix PC's.
_________________
Ps = (1.5 x 6 x .75) / {(4/3) (pi) [(31.039 x 10^15) (46.5 x 10^9)]^3}
Seems like a waste..
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sat Sep 05, 2009 22:33    Post subject: Re: Shutdown computers? Reply with quote
Slione wrote:
... is possible to shut them down at a certain time, kind of the reverse of WOL?

Windows XP

shutdown -s -f

shutdown /? for more options.

_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sat Sep 05, 2009 23:28    Post subject: Re: Shutdown computers? Reply with quote
GeeTek wrote:

Windows XP

shutdown -s -f

shutdown /? for more options.


They are XP machines but I am not awake when these machines are backing up. The cron job I run wakes them up at midnight for backing up to a server, the server will back them up at some random time between midnight and 6 am. What I am looking for is a script (or something) that will shut them down at let's say 6:15 am.

@the.root:

Can you give me some examples of SSH commands that might work? I am not well versed in that but could learn!

Thanks.

_________________
WRT1900AC v1-build r30731
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sat Sep 05, 2009 23:52    Post subject: Re: Shutdown computers? Reply with quote
Slione wrote:
What I am looking for is a script (or something) that will shut them down at let's say 6:15 am.


shutdown -s -f

Save that one line as a batch file. To do this you can copy and paste that line into notepad and save it as a text file. Then change the file extension from .txt to .bat to make it an executable batch file. The use Windows Scheduled Tasks in the control panel to run the batch file at 6:15 AM.

_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Sun Sep 06, 2009 0:29    Post subject: Re: Shutdown computers? Reply with quote
Slione wrote:
GeeTek wrote:

Windows XP

shutdown -s -f

shutdown /? for more options.


They are XP machines but I am not awake when these machines are backing up. The cron job I run wakes them up at midnight for backing up to a server, the server will back them up at some random time between midnight and 6 am. What I am looking for is a script (or something) that will shut them down at let's say 6:15 am.

@the.root:

Can you give me some examples of SSH commands that might work? I am not well versed in that but could learn!

Thanks.


Do you want to "Shut them down" or "Put them back to sleep"?

_________________
The New Me
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sun Sep 06, 2009 0:41    Post subject: Re: Shutdown computers? Reply with quote
GeeTek wrote:
shutdown -s -f

Save that one line as a batch file. To do this you can copy and paste that line into notepad and save it as a text file. Then change the file extension from .txt to .bat to make it an executable batch file. The use Windows Scheduled Tasks in the control panel to run the batch file at 6:15 AM.


Thanks GeeTek I'll give that a shot!

@DHC_DarkShadow:

For now I need these computers to be shut down....I never really thought about putting them to sleep....hmmmm something else to ponder.

_________________
WRT1900AC v1-build r30731
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Sun Sep 06, 2009 0:57    Post subject: Re: Shutdown computers? Reply with quote
Slione wrote:
GeeTek wrote:
shutdown -s -f

Save that one line as a batch file. To do this you can copy and paste that line into notepad and save it as a text file. Then change the file extension from .txt to .bat to make it an executable batch file. The use Windows Scheduled Tasks in the control panel to run the batch file at 6:15 AM.


Thanks GeeTek I'll give that a shot!

@DHC_DarkShadow:

For now I need these computers to be shut down....I never really thought about putting them to sleep....hmmmm something else to ponder.


If you shut them down, will somebody restart them? I am concerned for the backup the next night. Not sure if these are used computers or not, but if you just want them back asleep there is nothing else to do, they will sleep on there own.

_________________
The New Me
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sun Sep 06, 2009 2:07    Post subject: Re: Shutdown computers? Reply with quote
DHC_DarkShadow wrote:

If you shut them down, will somebody restart them? I am concerned for the backup the next night. Not sure if these are used computers or not, but if you just want them back asleep there is nothing else to do, they will sleep on there own.


Actually they will be re-awakened the next day with the cron job I put in the router:

0 0 * * * root /usr/sbin/wol -i 192.168.1.255 00:00:00:00:000:00

(the zero's are to protect the guilty computer! Very Happy "

_________________
WRT1900AC v1-build r30731
5 ACES
DD-WRT User


Joined: 13 May 2008
Posts: 228
Location: Colorado (USA)

PostPosted: Sun Sep 06, 2009 3:27    Post subject: Reply with quote
the.root wrote:
What OS are running on these machines? Could always make a script, using ssh commands to connect and poweroff *nix PC's.


How about Vista? Can this be done the same way as XP?
LrdShaper
DD-WRT Novice


Joined: 01 Jun 2008
Posts: 31

PostPosted: Sun Sep 06, 2009 11:47    Post subject: Reply with quote
How exactly are you backing up your PC? Is it a software on your PC that runs once you WOL it from your router?
_________________
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sun Sep 06, 2009 12:34    Post subject: Reply with quote
LrdShaper wrote:
How exactly are you backing up your PC? Is it a software on your PC that runs once you WOL it from your router?


It's actually a Windows Home Server (WHS) that does the backing up. The pcs just need to be on and the WHS does the backups between midnight and 6 am.

_________________
WRT1900AC v1-build r30731
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sun Sep 06, 2009 12:40    Post subject: Re: Shutdown computers? Reply with quote
GeeTek wrote:
shutdown -s -f

Save that one line as a batch file. To do this you can copy and paste that line into notepad and save it as a text file. Then change the file extension from .txt to .bat to make it an executable batch file. The use Windows Scheduled Tasks in the control panel to run the batch file at 6:15 AM.


I setup the batch file with this command, setup the Windows Scheduled task and when the time hit all that happened was a Command window opened up and the shutdown -s -f command was scrolling. I thought it might have been a problem with me being logged in remotely so I reset the time for the scheduled task to run again and made sure I was not logged on remotely and it still did not shut it down.

I don't know if this will help but when the machine gets woken up it just sits at the signon screen. Is this method supposed to work from just the signon screen? Confused

_________________
WRT1900AC v1-build r30731
Mordak
DD-WRT Guru


Joined: 27 Dec 2007
Posts: 933
Location: Lee, Me

PostPosted: Sun Sep 06, 2009 13:55    Post subject: Reply with quote
This might be a cool post to add to the Wiki for the different operating systems to do these WOL and SOL (Sleep on Lan Wink) functions.
_________________

ASUS AC3200
Linksys WRT32X
Linksys WRT3200 ACM
LrdShaper
DD-WRT Novice


Joined: 01 Jun 2008
Posts: 31

PostPosted: Sun Sep 06, 2009 14:21    Post subject: Reply with quote
Slione wrote:
LrdShaper wrote:
How exactly are you backing up your PC? Is it a software on your PC that runs once you WOL it from your router?


It's actually a Windows Home Server (WHS) that does the backing up. The pcs just need to be on and the WHS does the backups between midnight and 6 am.


I don't have DD-WRT running on any of my routers now so I can't test but there's a nifty little utility in the samba package that let's you shutdown a windows machine remotely:

net rpc shutdown -I ipAddressOfWindowsPC -U username%password

This will issue a shutdown command to the Windows machine. username must be an administrator on the Windows machine. Other relevant commands are:

net rpc shutdown -r : reboot the Windows machine

net rpc abortshutdown : abort shutdown of the Windows machine

I use WOL and net rpc extensively on my network to wake up, backup and shutdown the computers on my network one by one. Hope this helps, cheers!

_________________
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum