cron daily reboot. Ignore if parity check?


Swixxy

Recommended Posts

I currently have a cron job set up to restart my server every night. However if a parity check is running and has not completed, it gets interrupted by the shutdown process. Is there a way to check if a parity is running? Or ideally any disk process (like rebuilding a disk etc)

 

I use the powerdown script to restart currently. I manually remove the cron when doing a parity check/disk upgrade. However would love to make it automated

Link to comment

I currently have a cron job set up to restart my server every night. However if a parity check is running and has not completed, it gets interrupted by the shutdown process. Is there a way to check if a parity is running? Or ideally any disk process (like rebuilding a disk etc)

 

I use the powerdown script to restart currently. I manually remove the cron when doing a parity check/disk upgrade. However would love to make it automated

 

Have you tried the s3_sleep plugin? It has an option to powerdown the system.

 

Link to comment

Mind if I ask why you restart your server nightly?

 

As for the cron, you could set your restart cron job to run everyday besides the 1st of the month (or whichever day you run your parity check). ie something like 0 23 2-31 * * /path/to/script

My plex docker and a few others seem to not respond sometimes after a while, the app seemingly hangs. This way all my dockers restart daily so I don't have to manually restart them sometimes. Ideally I'd just restart all dockers however I couldn't find a way to do this easily (without updating it for each docker I add)

 

The system only takes 4 minutes to go fully down and back up though, so it's not really a problem, so far! Although I'm sure one day I'll need my files and curse it to high heaven for going offline at 4:40am ! :P

I think that this works, however you might want to check with Bonienl

 

cat /proc/mdcmd | grep 'mdResync='

If the value is >0 a check / rebuild is running

 

This is what I was looking for. Thank you I will look into this.

Link to comment

Have you tried using the following commands:

 

/etc/rc.d/rc.docker stop

Sleep 60

/etc/rc.d/rc.docker start

 

I dont know if the sleep between the stop and start are required.

have just tried this

/etc/rc.d/rc.docker stop && /etc/rc.d/rc.docker start

 

and it actually seems to be perfect for what i need! Thank you! I assumed that the dockers would not auto-start just using the docker command as i assumed (wrongly) that the dockers auto-starting was to-do with the unraid docker plugin rather than the actual rc.docker itself.

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.