Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Powerdown in X hours

Featured Replies

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?

You could execute the following in a screen session:

 

sleep seconds ; powerdown

powerdown | at 10 pm

 

No screen needed.

 

Or

powerdown | at now + 10 hours

  • Author

powerdown | at 10 pm

 

No screen needed.

 

Or

powerdown | at now + 10 hours

 

Thank you! I will try your method and hope for the best.

 

Thanks!!!

mine went down straightaway

powerdown.jpg.f9cf78261b777bcd941705eb547b013b.jpg

  • Community Expert

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.

  • Author

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!

Would this be something of value for folks for us to add as a configurable feature in the WebGUI?  Would others take advantage of this?

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)

 

 

 

It worked for me too.

 

I would like a shell script to check at (say) 10:00pm to see if all disks are spun down and if they are do a powerdown, I would like to integrate it in my go command file, is this possible?  any takers?

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.

  • Author

Would this be something of value for folks for us to add as a configurable feature in the WebGUI?  Would others take advantage of this?

 

YES! That would be great!

OK I'm going to move this from general support to a feature request in the roadmap forum. 

Hi Fireball,

 

I eventually found your S3 script, it took me 30 minutes, was on page 31 of 32.  I will see if I can use it.

 

Thank you.

I'm sorry that it took you so much time. I modified the link in my sig straight to the latest version.

 

Not to worry, I am grateful for it.

 

It's now 14:37pm, I'll let you know tomorrow if it doesn't work! (I'm sure it will)

 

Thanks again,

Bruce

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.