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.

[SOLVED] Help creating a weekly graceful reboot schedule

Featured Replies

My server runs non stop with minimal servicing.  I find when it's up from 1.5 to 8 weeks the server's internet speed is seriously slowed on everything from Dockers to VMs.  I don't find this as off because I reboot all my computers once a week but unRAID get neglected because it's the server and I don't think about it when I'm home and I'm also away from home relying on unRAID to keep chugging on it's own.  I was wandering if there was either a plugin, or command I can use in a cron script, to have my server reboot every week on a certain day @ 0400.  Since the problem always manifests greater than one week, usually closer to 2 weeks, and after a reboot the whole server functions better as a whole makes me feel this is a good idea.  

 

I've been searching the internet and Lime-Tech forms high and lot to find this answer and nothing has came from it.  If anyone could help me I would GREATLY appreciate it.

 

Oh, yeah, I'm running unRAID 6.3.3 at the time of writing this.

 

It would be nice if a reboot was able to be scheduled from the Scheduler but I'm not asking for that because I know you have more pressing matters.

 

Thank you for your time,

 

Rudder2

User scripts plugin

Script will be

powerdown -r

Sent from my LG-D852 using Tapatalk

  • Author

Thank you so much Squid!   This is exactly what I needed!

  • Rudder2 changed the title to Help creating a weekly graceful reboot schedule
  • Author

Squid, I spoke too soon.  I cannot get the powerdown -r to function because I cannot find the location of the powerdown command to write my own user script and I cannot find a pre written powerdown -r script.  I've once again search google high and low and have resorted back to this form.  I keep getting a this error:

 

Script location: /tmp/user.scripts/tmpScripts/powerdown -r/script
Note that closing this window will abort the execution of this script
/usr/local/emhttp/plugins/user.scripts/startScript.sh: /tmp/user.scripts/tmpScripts/powerdown -r/script: /bin/bashpowerdown: bad interpreter: No such file or directory

 

The script I wrote is 

 

#!/bin/bashpowerdown -r

 

Please tell me what I'm doing wrong.

 

Sorry for any inconvenience.

 

Thank you for you time,

 

Rudder2

Edited by Rudder2
Messed up

Squid, I spoke too soon.  I cannot get the powerdown -r to function because I cannot find the location of the powerdown command to write my own user script and I cannot find a pre written powerdown -r script.  I've once again search google high and low and have resorted back to this form.  I keep getting a this error:
 
Script location: /tmp/user.scripts/tmpScripts/powerdown -r/script
Note that closing this window will abort the execution of this script
/usr/local/emhttp/plugins/user.scripts/startScript.sh: /tmp/user.scripts/tmpScripts/powerdown -r/script: /bin/bashpowerdown: bad interpreter: No such file or directory
 
The script I wrote is 
 
#!/bin/bashpowerdown -r
 
Please tell me what I'm doing wrong.
 
Sorry for any inconvenience.
 
Thank you for you time,
 
Rudder2

Read the op or add a script and edit it within the plugin itself

Sent from my LG-D852 using Tapatalk

  • Author

This is going to sound stupid but I don't understand acronyms...What does op mean?  I've read over and over what you originally said Squid but end up with more questions than answers.  I went to the Plugin Page and read all I could there and even went to the Scripts page and read there.  Yes, I discovered when I saved the script it didn't save with the enter the first time. Should of saw that when I copied and pasted, Thanks for pointing that out CHBMB. 

 

 

The new saved script it:

 

#!/bin/bash

powerdown -r

 

And I get this error now:

 

Script location: /tmp/user.scripts/tmpScripts/powerdown -r/script
Note that closing this window will abort the execution of this script
/tmp/user.scripts/tmpScripts/powerdown -r/script: line 2: powerdown: command not found

 

Ironically, when I type powerdown -r in terminal it works fine.  I think I need to know the location of the powerdown file to put in the script but I don't know that for sure.

 

 

Thank you for your time,

 

Rudder2

Create a file called "script" containing only this

 

powerdown -r

Copy that file to your flash drive, in the folder config/plugins/user.scripts/scripts/powerdown/

 

Job done.

  • Author

I tried that and I get command not found.

 

Script location: /tmp/user.scripts/tmpScripts/powerdown -r/script
Note that closing this window will abort the execution of this script
/tmp/user.scripts/tmpScripts/powerdown -r/script: line 2: powerdown: command not found

 

 

  • Author

powerdown script.jpg

  • Author

6.3.3

You May have to give it the full path. Probably wrong but off the top of my head /usr/sbin/powerdown -r

Sent from my LG-D852 using Tapatalk

  • Author

It works.  The complete path is /usr/local/sbin/powerdown -r and you must use it.

 

Thank you both CHBMB and Squid!  I though that was the problem but nowhere on-line could I find that path.

 

The working script

 

5910f477e6d03_Theworkingpowerdownuserscript.jpg.7f3d864afb6a8b9887296270506ce078.jpg

 

Just want to spell it out so the next person who looks for this will hopefully be able to get it to work without asking.  I'm all about self help but sometimes after days of searching and coming up short I eventually ask for help.  I've been researching this for 3 days till I got frustrated and asked for help.

 

Thank you for both of your time so much!

 

Rudder2

  • Rudder2 changed the title to [SOLVED] Help creating a weekly graceful reboot schedule

Just a thought.... the powerdown -r command might be deprecated.  I'll need to check.

1 hour ago, CHBMB said:

Just a thought.... the powerdown -r command might be deprecated.  I'll need to check.

It technically is, and is just a wrapper script for either the reboot or shutdown commands.  However its use is so prevalent that I for one would be mildly peeved  should that wrapper script ever not be included in unraid (and would be forced to create a plugin just to have the script present).  (IE: no matter how much LT says its deprecated, I've been saying powerdown -r for years now, and will continue to say it for years to come)

Edited by Squid

So does shutdown/reboot perform a graceful shutdown? Does it abort current disk activity? Can it cause corruption on the file system? Does it interface with the UPS?

 

I remember reading that there are issues with shutdown.

Shutdown / reboot / powerdown all perform a graceful shutdown.  There are some edge cases where it is possible that it won't work - akin to Windows sitting there on a shutdown screen stating that "program xxxx" is preventing this computer from shutting down, but those edge cases are rare.

 

Not sure what you exactly mean by interface with the UPS though.  The UPS can trigger a powerdown of unRaid (which runs the shutdown routine).  

5 hours ago, MrCrispy said:

I remember reading that there are issues with shutdown.

 

5 hours ago, Squid said:

Shutdown / reboot / powerdown all perform a graceful shutdown.

 

Until unRAID v6.? it was not performing a graceful shutdown by default.

Posts from former times are still spread all over the forum so that's where you probably read about it.

 

  • 6 months later...
On 5/9/2017 at 12:49 AM, Rudder2 said:

It works.  The complete path is /usr/local/sbin/powerdown -r and you must use it.

 

Thank you both CHBMB and Squid!  I though that was the problem but nowhere on-line could I find that path.

 

The working script

 

5910f477e6d03_Theworkingpowerdownuserscript.jpg.7f3d864afb6a8b9887296270506ce078.jpg

 

Just want to spell it out so the next person who looks for this will hopefully be able to get it to work without asking.  I'm all about self help but sometimes after days of searching and coming up short I eventually ask for help.  I've been researching this for 3 days till I got frustrated and asked for help.

 

Thank you for both of your time so much!

 

Rudder2

 

Thanks! I just had my unRAID freeze after it worked nicely for an entire week. I will try scheduled restarts to see if that makes the system more stable. :)

  • 3 years later...

Need to stop array before running powerdown -r?

Or powerdown -r does this automatically?

And the VM? Do I need some command to shut down first?

Edited by Braulio

  • 2 weeks later...

A graceful shutdown stops all docker containers and VMs gracefully, without issue.

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...

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.