Powerdown in X hours


Recommended Posts

Hello!

 

I am looking for a way to turn off my unRAID server either at a certain time, or after a certain amount of time through shell. For example, if I know that if I run

 

powerdown

 

Unraid will shutdown gracefully. What I would like to do is run this on a time delay, or at a specific time. I would also presume that I would need to run this in:

 

screen

 

so it would continue to run in the background when I exit the session. Can someone point me in the right direction?

Link to comment

Looking here at the syntax/behaviour of the at command then I am not sure that the example given was correct.  The command as given would pipe output of the powerdown to that 'at' command, whereas what you want to do is pass the name of the command to be executed to the 'at' command.

 

It might be worth trying something like

echo "powerdown" |  at 10 pm 

instead?

 

I see there is a related 'atq' command to show you items that have been queued by the 'at' command.

Link to comment

Looking here at the syntax/behaviour of the at command then I am not sure that the example given was correct.  The command as given would pipe output of the powerdown to that 'at' command, whereas what you want to do is pass the name of the command to be executed to the 'at' command.

 

It might be worth trying something like

echo "powerdown" |  at 10 pm 

instead?

 

I see there is a related 'atq' command to show you items that have been queued by the 'at' command.

 

Thank you, your command worked perfectly. Without using echo, I had the same problem and it shutdown right away

 

Thanks!

Link to comment

An automated power down would be nice.

A sleep function albeit harder would be nicer.

 

I think you may want to consider schedule-able limetech events.

 

With one interface to schedule events, it might be easier to work with.

 

Events such as

 

 

sleep

powerdown

parity check

mover

hasher(verifier) (this would be nice, more to come with idea's later)

(I have many other ideas here too, but I'll refrain).

 

Powerup can be a bios configurable function for people.

 

Keep in mind, you can 'drop' cron style files in /etc/cron.d individually.

 

Here is an example of mine

root@unRAID:/mnt/disk1/home/rcotrone/src.slacky/hashtools# more /etc/cron.d/*
::::::::::::::
/etc/cron.d/filelist
::::::::::::::
#
# ---[ filelist ]-----------------------------
#
00 00 * * * /usr/bin/nice -n 19 /boot/bin/filelist.bash 1 2 3 2>&1 | logger -tfilelists[$$]
#
# md5sum of whole disk once a week. 
# 00 00 * * 1 md5deep -r -of /mnt/disk1 > /mnt/disk1/filedb/disk1.md5sum
# 00 00 * * 2 md5deep -r -of /mnt/disk2 > /mnt/disk2/filedb/disk2.md5sum
# 00 00 * * 3 md5deep -r -of /mnt/disk3 > /mnt/disk3/filedb/disk3.md5sum
#
# * * * * * <command to be executed>
# | | | | | 
# | | | | | 
# | | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
# | | | +------ Month of the Year (range: 1-12)
# | | +-------- Day of the Month  (range: 1-31)
# | +---------- Hour              (range: 0-23)
# +------------ Minute            (range: 0-59)


::::::::::::::
/etc/cron.d/md_write_method
::::::::::::::
30 08 * * * /root/mdcmd set md_write_method 1
30 23 * * * /root/mdcmd set md_write_method 0
#
# * * * * * <command to be executed>
# | | | | |
# | | | | |
# | | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
# | | | +------ Month of the Year (range: 1-12)
# | | +-------- Day of the Month  (range: 1-31)
# | +---------- Hour              (range: 0-23)
# +------------ Minute            (range: 0-59)


::::::::::::::
/etc/cron.d/parity_check
::::::::::::::
00 00 27 * * /root/mdcmd check NOCORRECT
#
# * * * * * <command to be executed>
# | | | | |
# | | | | |
# | | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
# | | | +------ Month of the Year (range: 1-12)
# | | +-------- Day of the Month  (range: 1-31)
# | +---------- Hour              (range: 0-23)
# +------------ Minute            (range: 0-59)

 

 

 

Link to comment

See my sig for a powerdown script that checks the array status and performs either

powerdown or S3 (it is widely configurable).

 

It would be nice to see that functionality included in stock unRAID one day.  ;)

 

The daily powerdown @10 o'clock is easily done through the go-file or a cron-job, as already mentioned above.

Link to comment

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.