[SOLVED] Help creating a weekly graceful reboot schedule


Recommended Posts

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

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

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
Link to comment
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

Link to comment

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

Link to comment

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

 

 

Link to comment

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

  • Like 1
  • Upvote 1
Link to comment
  • Rudder2 changed the title to [SOLVED] Help creating a weekly graceful reboot schedule
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
Link to comment

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

Link to comment
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.

 

Link to comment
  • 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. :)

Link to comment
  • 3 years later...
  • 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.