Discussion:
[rancid] Receiving empty mails
Vanja Luk
2017-03-29 21:41:41 UTC
Permalink
The backup schedule via cron works fine and if there are some diffs we are
getting them via email, but an empty mail is sent even if there are no
changes.

Is there any way to avoid such behavior?

Thanks.
Vanja
Vanja Luk
2017-03-30 11:40:30 UTC
Permalink
Hello,
I have found out that the empty mails are sent only if a diff script is
enabled for the email notification:

MAILHEADERS="Content-Type: text/html; charset=ISO-8859-1"; export
MAILHEADERS
DIFFSCRIPT="/etc/rancid/diff2html.py"; export DIFFSCRIPT

As soon as the script is commented rancid does not send empty emails any
more.
Post by Vanja Luk
The backup schedule via cron works fine and if there are some diffs we are
getting them via email, but an empty mail is sent even if there are no
changes.
Is there any way to avoid such behavior?
Thanks.
Vanja
heasley
2017-03-30 13:09:50 UTC
Permalink
Post by Vanja Luk
DIFFSCRIPT="/etc/rancid/diff2html.py"; export DIFFSCRIPT
As soon as the script is commented rancid does not send empty emails any
more.
test it manually and separately from rancid. does it work as described in
rancid.conf(5).
Vanja Luk
2017-03-30 13:29:13 UTC
Permalink
Tried directly in command line with two diffs:
git diff -C -M ad78a3e0cf8a14e3c1c2d0a0ba354e7580d9b9de
e072c5c2033884852ff1c3b1290d22292f73373d -- "routers/configs/router1" |
/etc/rancid/diff2html.py > diff.html
and the output is as expected.

Checked the script too, and there are no email triggers in it. The same
scenario is when I use another script written in bash.
The diff script is triggered every time rancid schedules a job no matter
new diffs are recorded or not.
Post by heasley
Post by Vanja Luk
DIFFSCRIPT="/etc/rancid/diff2html.py"; export DIFFSCRIPT
As soon as the script is commented rancid does not send empty emails any
more.
test it manually and separately from rancid. does it work as described in
rancid.conf(5).
Loading...