Hi, I was wondering if there was a way to receive an email from the snapraid diff script only if an error occurs instead of either no email or the full script output ?
Thanks
Hi, I was wondering if there was a way to receive an email from the snapraid diff script only if an error occurs instead of either no email or the full script output ?
Thanks
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.
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.
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.
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.
Don’t have an account yet? Register yourself now and be a part of our community!