[Dirvish] sending mail on any failure
emsearcy at gmail.com
Thu Apr 16 16:17:56 UTC 2009
> Yes, basically. Except I don't want it mailing me at all if there is
> not an error. I also want it mailing me on ANY error - in the rsync or
> pre/post scripts.
We followed a typical "output=error" scenario.
We were running dirvish-runall with --quiet, so the only output there
was from dirvish itself when a vault or script failed.
However, we didn't want to have to track down what the error was when a
vault failed, so I set up a post-server script based on some ideas from
the wiki that would email what the dirvish error was. Here's the
# Return on success or warning if non-verbose mode
if [ $VERBOSE -eq 0 -a \( $DIRVISH_STATUS = "success" -o \
$DIRVISH_STATUS = "warning" \) ]; then
# Choose files to output
if [ -f $DIRVISH_DEST/../rsync_error ]; then
# Create email
cat $FILELIST | mail -s \
"Dirvish $DIRVISH_CLIENT: $DIRVISH_STATUS" \
Summary for this, which I think matches what you want, but YMMV:
* Run dirvish so that it only outputs on errors (causing cron mail).
This means "dirvish-runall --quiet" and no --summary option to "dirvish"
itself. This will give only general info, like "post-server failed" I
* Have your scripts generate output on errors. This provides fuller
debugging for them.
* Use a post-server script as above to provide fuller dirvish debugging
info when needed.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.dirvish.org/pipermail/dirvish/attachments/20090416/3bea402f/attachment.bin
More information about the Dirvish