snapraid-runner icon indicating copy to clipboard operation
snapraid-runner copied to clipboard

Added support for waiting for other processes

Open exterrestris opened this issue 5 years ago • 4 comments

Detect lock files from other processes that are/may be modifying the data disks and wait for them to be removed before continuing with the diff/sync.

I use StableBit Drivepool to pool my data disks, and have a landing zone to help prevent writes to the data disks while a sync is underway (and for protection against disk failure). This is configured to 'rebalance' onto the main data disks daily before the scheduled sync, with a file created to indicate that a balance is in progress - using the functionality added in this PR, I can get the script to pause until the balance has completed. As another example, it could also be used to wait for a long-running backup to complete.

exterrestris avatar Jan 15 '20 00:01 exterrestris

What is the advantage of having this functionality in snapraid-runner compared to having a wrapper-script?

Chronial avatar Feb 29 '20 13:02 Chronial

Primarily, the benefit is that it ties into the same logging and email functionality and configuration, which avoids the need to duplicate that functionality and configuration. It also makes it's clear as to what happens during a run - whether it is aborted completely, or merely delayed, together with with the cause. Besides snapraid-runner is itself a wrapper script - creating yet another wrapper around it feels unnecessary.

exterrestris avatar Mar 19 '20 10:03 exterrestris

Would #50 address your use-case?

Chronial avatar Oct 31 '21 11:10 Chronial

Apologies for taking so long to reply. Since creating this PR I've switched my home server from Windows to Linux, and changed the structure of my disks such that this is no longer really an issue for me. Having said that, #50 would still be a useful addition for me for other reasons - for this use case, as long as the 'pre-hook' could abort the sync then yes it would address it

exterrestris avatar May 29 '22 01:05 exterrestris