[HowTo] SnapRAID in OMV

  • I understand that to use scheduled syncs, scrubs and diffs I should set up scheduled jobs in OMV GUI to execute related scripts.

    I could not find any reference how this should be done. What are the commands that should be called?

  • Can anyone explain what


    Code
    "scrub_age=5"


    does in the provided scripts?


    Second question:

    What exactly happens when i exclude specific dirs in the Snapraid rules section?

    I guess these files/dirs are excluded from all sync/scrub/diff and other jobs?

    Does this setting only work if i use the OMV provided scripts or will it also work with the external scripts referenced in this thread?

  • What exactly happens when i exclude specific dirs in the Snapraid rules section?

    I guess these files/dirs are excluded from all sync/scrub/diff and other jobs?

    Does this setting only work if i use the OMV provided scripts or will it also work with the external scripts referenced in this thread?


    To answer for anyone that wants to know: this should work independantly from any scripts as it is added to general snapraid.conf

  • Great job on the snapraid plugin ryecoaaron and the snapraid diff script Solo0815 !

    I was just about to create a manual scheduled job until I saw the awesome report functions inside the snapraid diff script.

    I just feel like the "SCRUB_OLDER_THAN_DAYS" variable is essential and should be implemented into the pluging ASAP ;)

  • So use another script. There are several available that have the capability you seek.

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


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

  • So use another script. There are several available that have the capability you seek.

    It is in the script, just not in the plugin.

    Of course I can change it in the script manually, but then I don't know if it will survive the next update to the plugin.

    The cleanest way would be to set it in the snapraid-diff.conf but here it states:

    Code: snapraid-diff.conf
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    
    ...

    So it would be a lot nicer if it was possible to set this variable from the plugin.

  • It is in the script, just not in the plugin.

    Of course I can change it in the script manually, but then I don't know if it will survive the next update to the plugin.

    The cleanest way would be to set it in the snapraid-diff.conf but here it states:

    Code: snapraid-diff.conf
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    
    ...

    So it would be a lot nicer if it was possible to set this variable from the plugin.

    As I said. Use another script and stop using this one.

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


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

  • I quite like that approach it is more or less the best use case for me as well. After setting up the scheduled tasks I am running into the following error sent by email:


    /bin/sh: 1: Syntax error: Unterminated quoted string


    I am not sure why the cronjob with the scrub command couldn't been executed due to a syntax error. What do I have to adjust or where can I look? In the system logs I did not find anything under snapraid.


    If I do a manual run within the GUI, everything completes just fine.

  • I did handtype it from the very first time, too. There is a space after ";" in the forst command between "snapraid touch; snapraid sync" correct?


    I did set it up again, let's see what happens next time. Meanwhile I did successfully finish it with a manual run.

  • Hi everyone,


    Last year I posted a SnapRAID script here, which has been downloaded more than I expected (181 times!!!).


    I worked to improve it with bug fixes and new features.


    The latest version is available on GitHub and you can find it here. I hope it helps!

  • auanasgheps Thanks for this script! I have been looking for a way to automate SnapRAID in OMV5.


    I downloaded your script on my PC (Win10) and would like to customize and deploy it to my OMV5 installation. Could you provide more detailed steps on how to achieve that? I know that I can very likely customize it using Notepad++, but I have absolutely zero clue how to deploy it to OMV and schedule it. As you can tell, my experience with Linux is limited, but I can make things work with some guidance. Any help is appreciated. Thanks!

  • auanasgheps Thanks for this script! I have been looking for a way to automate SnapRAID in OMV5.


    I downloaded your script on my PC (Win10) and would like to customize and deploy it to my OMV5 installation. Could you provide more detailed steps on how to achieve that? I know that I can very likely customize it using Notepad++, but I have absolutely zero clue how to deploy it to OMV and schedule it. As you can tell, my experience with Linux is limited, but I can make things work with some guidance. Any help is appreciated. Thanks!

    Hi!

    Extract the ZIP and use WinSCP to copy the two files from Windows to /usr/sbin/snapraid. There's no snapraid folder in there so create it first.

    Then follow my simple instructions in Github.


    Making changes it's very easy: every configuration has a description. If you are unsure, don't change it, defaults are pretty good.


    To schedule the script (or really anything else),

    • Login in OMV GUI
    • Go to System > Scheduled Jobs.
    • Create a new job, schedule the execution time. I recommend a daily run when the server is not really in use.
    • Keep user as root
    • Command is the path of the script executable, e.g. /usr/sbin/snapraid/snapraid-aio-script.sh

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

Jetzt mitmachen!

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