Scheduled Power off/Power on, Restart possible?


Recommended Posts

In QNAP and Thecus NASes I can set-up a schedule to power off and power on the NAS at certain times. Is this at all possible in Unraid? I can probably set a cron job to call the powerdown script but power up will be impossible then. So it should be putting the server to sleep and waking up then?

It depends on your BIOS.

 

Some BIOS have the ability turn on at a certain time, others do not.  It entirely depends on your motherboard.

 

As you said, you can set up a cron task to stop the array and power down.

 

Joe L.

Link to comment

Most bioses have an option for  "resume on powerloss". Whenever power is gone you can choose between "on / off / last state".

 

If you put that on "on" and setup a cheap power/timer clock between pc and wall socket you can get what you want :

 

01:00 shut down array and power down system

 

01:30 cut power using the timer

 

06:00 restore power using timer

 

On restore of power system will turn on abd boot into unraid.

 

What is my major issue with this is that I allmost always have to do manual stuff to get the system to shudown without a parity check on restart.

Link to comment

Most bioses have an option for  "resume on powerloss". Whenever power is gone you can choose between "on / off / last state".

 

If you put that on "on" and setup a cheap power/timer clock between pc and wall socket you can get what you want :

 

01:00 shut down array and power down system

 

01:30 cut power using the timer

 

06:00 restore power using timer

 

On restore of power system will turn on abd boot into unraid.

 

What is my major issue with this is that I allmost always have to do manual stuff to get the system to shudown without a parity check on restart.

 

 

Will this work on the X9SCM-F with BIOS 2.0a too?  Would be nice if this could be done with a UPS.

Link to comment

Most bioses have an option for  "resume on powerloss". Whenever power is gone you can choose between "on / off / last state".

If you put that on "on" and setup a cheap power/timer clock between pc and wall socket you can get what you want :

01:00 shut down array and power down system

01:30 cut power using the timer

06:00 restore power using timer

On restore of power system will turn on abd boot into unraid.

What is my major issue with this is that I allmost always have to do manual stuff to get the system to shudown without a parity check on restart.

You can't just cut the power on the unraid server, i assume you're using a UPS in this scenario, which will do a clean powerdown when you cut power. Besides the fact that you are abusing the UPS this way, there is a bigger risk. Normally, in case of a power loss, you not only want to powerdown the unraid server in a clean way ASAP, but after that is done, also shutdown the UPS. If you don't, in case the power returns for like a minute or a few seconds and powers down AGAIN, you will be in the middel of starting up your unraid server again (because your using 'resume on powerloss') and you can't do a nice powerdown since the UPS probably is empty or near empty... this is why you do NOT want to resume on powerloss. Just stay off.

 

So, do not use the UPS as a handy on/off switch... it's an emergency device, treat it as such.

Link to comment

Most bioses have an option for  "resume on powerloss". Whenever power is gone you can choose between "on / off / last state".

If you put that on "on" and setup a cheap power/timer clock between pc and wall socket you can get what you want :

01:00 shut down array and power down system

01:30 cut power using the timer

06:00 restore power using timer

On restore of power system will turn on abd boot into unraid.

What is my major issue with this is that I allmost always have to do manual stuff to get the system to shudown without a parity check on restart.

You can't just cut the power on the unraid server, i assume you're using a UPS in this scenario, which will do a clean powerdown when you cut power. Besides the fact that you are abusing the UPS this way, there is a bigger risk. Normally, in case of a power loss, you not only want to powerdown the unraid server in a clean way ASAP, but after that is done, also shutdown the UPS. If you don't, in case the power returns for like a minute or a few seconds and powers down AGAIN, you will be in the middel of starting up your unraid server again (because your using 'resume on powerloss') and you can't do a nice powerdown since the UPS probably is empty or near empty... this is why you do NOT want to resume on powerloss. Just stay off.

 

So, do not use the UPS as a handy on/off switch... it's an emergency device, treat it as such.

 

While I fully agree with what you said regarding a UPS, that is not what was being recommended. Nowhere in the original post was UPS mentioned, but it should have been. The timer use case would be directly on the server power cord, on the OUTPUT of the UPS, not the wall side of the UPS. I agree that a UPS should always be used with a server, and the original suggestion should have made clear which SIDE of the UPS the timer should be controlling. With a properly sized and controlled UPS, resume on powerloss can be applied with minimal risk.

Link to comment

If you were using a physical timer/clock I would put it BETWEEN the wall outlet and the UPS.

Then, set up unRAID to cleanly stop itself when power is lost while powered by the UPS  (set it to power down after 15 seconds or so)  Set it to power down the UPS too, so its batteries are not exhausted.

 

Then, when timer is set to provide power back to the UPS, it will power up the server. 

 

That will work as long as you are able to cleanly stop all processes using the disks when powering down.

 

Joe L.

Link to comment

I have been wondering how to do this with my server (I am currently building it so havent actually tried my method yet, but in theorie it should work)

 

Thought I would share, perhaps it can help you.

 

My router supports the dd-wrt custom firmware, I am planning to flash it to this.

 

What I will do that is setup a WOL daemon on the router that will wake up my server every day at a specific time. (http://www.dd-wrt.com/wiki/index.php/WOL)

And run a cron job on the server itself to switch off at a certain time everyday

Link to comment
  • 11 years later...
On 9/23/2012 at 2:24 PM, Joe L. said:

Some BIOS have the ability turn on at a certain time,

Is that uncommon?  I am wondering if it is worth it to hook up a monitor and keyboard to my unraid and look into this.  Right now, I am guessing my odds are low.  

 

I got a run-of-the-mill board:

ASUSTeK COMPUTER INC. PRIME Q270M-C , Version Rev X.0x
American Megatrends Inc., Version 1607,  BIOS dated: Mon 21 Oct 2019

Link to comment
9 hours ago, xrqp said:

Is that uncommon?

 

In my experience waking at a specified time is almost universal.    What is less common is Wake-on-LAN.

 

I personally make use of that in conjunction with the Parity Check Tuning plugin option to restart array operations (from previous point reached) to allow me to automatically power my system off every night without it causing me issues.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.