Receive emails from SnapRaid diff script only when an error occurs ?

    • Official Post

    Is one email per day really that bad?


    You could edit the scheduled task in the System -> Scheduled Tasks tab to make it look something like this:


    for conf in /etc/snapraid/omv-snapraid-*.conf; do  /usr/sbin/omv-snapraid-diff "${conf}" >/dev/null 2>&1 || echo "Error in processing ${conf}" | mail -s "SnapRAID Error" your-email@example.com; done


    but as you can tell it doesn't integrate well with the notification settings in omv and you wouldn't get the full log emailed to you even on error.

    omv 7.4.9-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.12 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thank you. One email a day (twice per week in my case) is not bad at all, it's more the fact that I need to scroll a fair bit before knowing if the diff script went ok, instead of having a 'Diff script successful' in the email title or something like this. The solution you propose seems like a good option.

    • Official Post

    instead of having a 'Diff script successful' in the email title or something like this.

    Since cron is determining the subject and the script logs a bunch before it fails, it is hard to change this behavior without making the script much more complex.

    omv 7.4.9-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.12 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • One email a day (twice per week in my case) is not bad at all, it's more the fact that I need to scroll a fair bit before knowing if the diff script went ok, instead of having a 'Diff script successful' in the email title or something like this.

    Maybe another option: I have been using this for some time now: https://github.com/auanasgheps/snapraid-aio-script


    It's designed to work very well with OMV's Snapraid plugin and it emails the relevant info in a compact way and has the info you want in the email subject. IMHO it's a very good supplement to the Snapraid plugin.

Participate now!

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