wedge22 Posted November 2, 2020 Share Posted November 2, 2020 I have parity check scheduled for once per month and during the check I would like to have certain dockers pause their activity, this mainly applies to Sab as it uses a reasonable amount of cpu to unpack and move files. Is it possible to write a script that would do this, if so where can I find more details on this? Quote Link to comment
wedge22 Posted November 3, 2020 Author Share Posted November 3, 2020 Thanks this does help me, I have added the plugin along with a couple of the user scripts from the forum post you linked. Quote Link to comment
kizer Posted November 3, 2020 Share Posted November 3, 2020 No problem. I can honestly say I use User.Scripts nearly every day automating my system. I'm glad it helped you out. Quote Link to comment
NichollsGlen Posted June 6, 2023 Share Posted June 6, 2023 I'm noticing a small issue with the script above. I am using the Parity Check Tuning plugin to ensure that parity only runs during specific hours like in the middle of the night. Because of this, I noticed that when the plugin pauses parity check, "mdResyncPos" variable Squid's script checks is >0 and so my stop script isn't being called. Is there something else I can have the script check that will reliably tell me that parity is actively running? I've been polling that value while parity check is running and it looks like it might stay at a single value for quite a while so I don't think polling with a script would be very accurate. Quote Link to comment
itimpi Posted June 6, 2023 Share Posted June 6, 2023 18 minutes ago, NichollsGlen said: I'm noticing a small issue with the script above. I am using the Parity Check Tuning plugin to ensure that parity only runs during specific hours like in the middle of the night. Because of this, I noticed that when the plugin pauses parity check, "mdResyncPos" variable Squid's script checks is >0 and so my stop script isn't being called. Is there something else I can have the script check that will reliably tell me that parity is actively running? I've been polling that value while parity check is running and it looks like it might stay at a single value for quite a while so I don't think polling with a script would be very accurate. mdResyncPos is set to be none-zero when a parity check starts and its value indicates the point currently reached. You can then use mdResync to test if it is currently running (this is 0 when it is paused). Quote Link to comment
NichollsGlen Posted June 7, 2023 Share Posted June 7, 2023 Sounds good, thanks for the guidance! I don't know PHP and the simple changes I tried all caused the script to go haywire, so I ported and modified your script in Python - it can be found at https://github.com/GlenNicholls/unraid_parity_scripter . It uses JSON for the containers to stop when parity is running and containers to start when paused/stopped. I need to add some more stuff to make it generic such that it can be used out of the box in a generic environment, but your suggestions work. 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.