Snapraid Diff Script Delete Threshold

  • Hello,


    although I've been using Snapraid for some time now I just recently started using the diff script and I got a bit confused about the delete threshold.
    If I open up the Diff Script Settings it reads the following for the delete threshold: "Define threshold of files deleted to start the sync-process. default = 0 to make sure no sync process is started while testing or if there are any deleted files."
    So I assumed if I leave the value at 0 the diff script checks for differences and then does nothing regardless how many files have been deleted since the last sync.
    But then I received the output of the diff script via email and it read


    Code
    Changes detected [A-20,D-54355,M-0,C-0,U-2] -> there are deleted files (54355) but delete threshold (0) is disabled. Running SYNC Command
    SnapRAID SYNC Job started - Wed Mar  8 04:00:09 CET 2017

    In this context delete threshold = 0 apparently means that the threshold is disabled and the script will run a sync regardless how many files have been deleted.
    These are my current settings:



    So what does the delete threshold actually do? And how can I use it correctly?


    Thanks a lot for any help in advance.


    Edit:
    I'm running OMV 3.0.65 with kernel 4.9.0-0.bpo.1-amd64 and openmediavault-snapraid 3.6.2.

  • I'm in the same boat! Just started using Snapraid and started playing around with the omv-snapraid-diff script to help automate unsupervised syncing. I noticed the same message in my email notification about delete threshold being disabled. It appears that after running through a small test, 0 actually means disabled as stated in the email.


    TEST:
    1. deleted a couple test files
    2. verified that 'snapraid diff' produced deleted files in output
    3. scheduled the omv-snapraid-diff to run the next minute and then waited


    The email and the log files both showed that the sync took place even though there were more than 0 deleted files.


    Code
    There are differences! SnapRAID DIFF finished – Wed Mar 22 15:22:08 PDT 2017 ---------------------------------------- Changes detected [A-0,D-2,M-0,C-0,U-0] -> there are deleted files (2) but delete threshold (0) is disabled. Running SYNC Command SnapRAID SYNC Job started – Wed Mar 22 15:22:08 PDT 2017


    Code
    [2017-03-22 15:22:08] omv-snapraid-diff: INFO: 'SUMMARY of changes since last sync:'
    [2017-03-22 15:22:08] omv-snapraid-diff: INFO: 'Added: [0] - Deleted: [2] - Moved: [0] - Copied: [0] - Updated: [0]'
    [2017-03-22 15:22:08] omv-snapraid-diff: INFO: 'Changes detected [A-0,D-2,M-0,C-0,U-0] -> there are deleted files (2) but delete threshold (0) is disabled. Running SYNC Command.'
    [2017-03-22 15:22:08] omv-snapraid-diff: INFO: 'SnapRAID SYNC Job started'


    So it's probably best to set that value to 1 and hope that the 1 file isn't one that you will miss...

  • Just to add to this, I ran through some more testing. With a delete threshold setting of 1, if you have 1 file that has been deleted, the script will still run a sync!


    Code
    There are differences! SnapRAID DIFF finished – Thu Mar 23 08:21:08 PDT 2017 ----------------------------------------
    Changes detected [A-0,D-1,M-0,C-0,U-0] -> deleted files (1) is below threshold (1). Running SYNC Command SnapRAID SYNC Job started – Thu Mar 23 08:21:08 PDT 2017


    But if you have 2 files that have been removed with a delete threshold of 1, the sync does stop properly.


    Code
    There are differences! SnapRAID DIFF finished – Thu Mar 23 08:28:09 PDT 2017 ----------------------------------------
    Number of deleted files (2) exceeded threshold (1). NOT proceeding with sync job. Please run sync manually if this is not an error condition


    I think in the short term, this doesn't pose much of a problem. But it would be great to have a mechanism in place that completely stops syncs if there are any deleted files.

  • I set mine to 50 because I do occasionally delete some files but want it to prevent a sync if a whole bunch of files somehow get accidently deleted or if a drive fails (Snapraid or the diff-script might have other protections for that scenario?)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!