Snapraid - Sync, scrub, diff setup instructions

  • Hi,


    I have Snapraid configured on my NAS for a while, but I'm still not sure if it is set up the best way possible. My setup looks like this: 2 Data drives, 1 parity


    Most of my data is media, so I have a scheduled "snapraid sync" job running once a week. This seems to work, but when I look in the snapraid log files, it never mentions the weekly sync. Only when I do it manually. Is that normal?


    What about a "diff" or "scrub" job? Should I also do that every week or month? I hope someone can give me a few pointers on them.



    Thanks a lot!

  • Best setup is whatever works for you. I run all my snapraid jobs manually so I know it won't sync when it shouldn't.


    I always run snapraid diff to make sure a bunch of files aren't missing or got wiped out, then run the sync.


    Then periodically run status and do a scrub if needed.


    Others do it differently and it works for them.

  • so you do a diff before you sync? I thought it makes sense to do it right after, so it's a confirmation about a successful sync. Does it interfere with a sync, if i watch eg. a movie while the sync is running?

  • Don't sync without doing a diff first and understanding what it is telling you. Reading files from the array during SnapRAID operations is harmless. Adding files during a sync will generate warnings saying you shouldn't do that and suggest running the sync again.


    There are several well written scripts available that perform SnapRAID operations in a recommended order. Most users will find that such a script will satisfy their needs. OMV comes bundled with one.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 16GB ECC RAM.

  • Don't sync without doing a diff first and understanding what it is telling you. Reading files from the array during SnapRAID operations is harmless. Adding files during a sync will generate warnings saying you shouldn't do that and suggest running the sync again.


    There are several well written scripts available that perform SnapRAID operations in a recommended order. Most users will find that such a script will satisfy their needs. OMV comes bundled with one.

    Ok thanks. Can you please point me to those scripts or show me where I can find the existing one within OMV. Thanks a lot

  • In OMV's SnapRaid Settings see the Diff Script Settings section. To run it automatically in the scheduler, press the Schedules Diff button.


    I do not use OMV's provided script or its scheduled command.


    I use this script, I run it on cron @3:00am every fourth day:


    Code
    https://gist.github.com/mtompkins/91cf0b8be36064c237da3f39ff5cc49d

    There are others out there.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 16GB ECC RAM.

  • Thanks a lot. The script looks really nice and does what I want it to. I basically always want a sync every week, if files have changed.


    I never called a script in the scheduled jobs. Could you help me out a little with the config please?


    Lets say I save the script in "scripts/snapScript.sh" on my NAS. Do I have to call this exact command "scripts/snapScript.sh" ? Do I need to install something extra to send the mail or will it work when I enable the "send command output via mail" feature from the scheduled job wizard?


    Thank you in advance!

  • Do it by hand using crontab -e


    0 3 1,4,7,10,13,16,19,22,25,28,31 * * /usr/local/scripts/snapScript.sh >/dev/null 2>&1 #Run snapScript.sh script every fourth day @3:00am

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 16GB ECC RAM.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!