elfner11 Posted October 3, 2014 Share Posted October 3, 2014 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? Quote Link to comment
sureguy Posted October 3, 2014 Share Posted October 3, 2014 You could execute the following in a screen session: sleep seconds ; powerdown Quote Link to comment
dgaschk Posted October 3, 2014 Share Posted October 3, 2014 powerdown | at 10 pm No screen needed. Or powerdown | at now + 10 hours Quote Link to comment
elfner11 Posted October 5, 2014 Author Share Posted October 5, 2014 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!!! Quote Link to comment
Brucey7 Posted October 5, 2014 Share Posted October 5, 2014 mine went down straightaway Quote Link to comment
itimpi Posted October 5, 2014 Share Posted October 5, 2014 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. Quote Link to comment
elfner11 Posted October 5, 2014 Author Share Posted October 5, 2014 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! Quote Link to comment
jonp Posted October 5, 2014 Share Posted October 5, 2014 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? Quote Link to comment
WeeboTech Posted October 5, 2014 Share Posted October 5, 2014 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) Quote Link to comment
Brucey7 Posted October 5, 2014 Share Posted October 5, 2014 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? Quote Link to comment
Fireball3 Posted October 6, 2014 Share Posted October 6, 2014 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. Quote Link to comment
elfner11 Posted October 6, 2014 Author Share Posted October 6, 2014 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! Quote Link to comment
jonp Posted October 6, 2014 Share Posted October 6, 2014 OK I'm going to move this from general support to a feature request in the roadmap forum. Quote Link to comment
Brucey7 Posted October 7, 2014 Share Posted October 7, 2014 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. Quote Link to comment
Fireball3 Posted October 7, 2014 Share Posted October 7, 2014 I'm sorry that it took you so much time. I modified the link in my sig straight to the latest version. Quote Link to comment
Brucey7 Posted October 7, 2014 Share Posted October 7, 2014 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 Quote Link to comment
Recommended Posts
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.