Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: mackayr on January 18, 2006, 04:57:22 PM

Title: Is there a way to schedule automatic shut-downs?
Post by: mackayr on January 18, 2006, 04:57:22 PM
Here's my situation.  I had an old box sitting around (K6 2-450) which I've converted into a backup solution.  I've installed SME 7 pre1 (for testing purposes as well) and created an ibay.  Every morning, I do a 911 backup (backup2ws) into an ibay.  However, I'd like to have the computer turn on (just before 1 am) automatically and turn off when it's complete.  I know roughly when it completes, so I can just set a time to turn off if that's easier.  For turning it on, I can set that in the computer bios.

Are there any panels/contribs that will allow me to turn off the server at certain times?

Thanks for any advice!

Rob
Title: Is there a way to schedule automatic shut-downs?
Post by: byte on January 18, 2006, 05:27:44 PM
how about creating your own script and run via cron to your time you wish to shutdown?
Title: Is there a way to schedule automatic shut-downs?
Post by: AndyCocker on January 18, 2006, 06:10:55 PM
How would you get it to turn on automatically? Something like Wake On Lan?

Andy
Title: Is there a way to schedule automatic shut-downs?
Post by: byte on January 18, 2006, 06:36:17 PM
Quote
How would you get it to turn on automatically? Something like Wake On Lan?


Have look at this not tried on 7.0x http://no.longer.valid/phpwiki/index.php/Wake-Up-On%20LAN
Title: Is there a way to schedule automatic shut-downs?
Post by: mackayr on January 18, 2006, 06:49:02 PM
Turning on the machine is not the problem.  I can do that through the bios.  I have tried WOL previously, but had no luck getting it to work.  It was on an advanced DHCP panel.  I think my hardware was not compatible, though I had the WOL wires attached to the card and the bios set to allow WOL.  In any event, I don't recall that it had scheduling ability.

My problem is turning it off.  I considered a cron job, but I've never worked with those before.  Where can I get a good primer on that?  Are scripts hard/long to write, or is is just a matter of a few simple lines of code?

Thanks again!
Title: Is there a way to schedule automatic shut-downs?
Post by: byte on January 18, 2006, 08:12:22 PM
all i would use is...

Code: [Select]
#!/bin/sh
shutdown -h now


Then enter into a cron job and set the time and path to where your script is