On Thu, Apr 16, 2009 at 4:42 AM, Shawn (Red Mop) <[email protected]> wrote:
> On Wednesday 15 April 2009 03:03:52 am Dave Howorth wrote:
>> fostandy wrote:
>> > Hi, I'm new to this backup game. I'm wondering if there is a
>> > straightforward way I can make dirvish (or it's pre/post exec scripts)
>> > send an email if any stage of the backup process fails?
>>
>> My cron is set up to mail me with whatever output the job produces. So
>> there's no need for me to do anything at all to get errors.
>>
>> It does mean I normally get a mail every day telling me that the backup
>> has run. But the absence of that mail tells me there's something wrong
>> elsewhere in the system ...
>>
>
> Looking for something like this?  It adds [**] to the subject if there an
> error of some kind.
>
> Subject: Dirvish status (2009-04-15@(altered-host))
>
> Disk usage:
>                       3.5G  2.0G  1.5G  59% (altered-directory)
>
> Image disk usage:
> 4.1M   (altered-image-location)
> <snip>

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.

Anyway, turns out it was *reasonably* straightforward. In the end I
call a perl script that inserts a oneshot into cron.d to call itself
with arguments in 10 minutes time. When invoked it scans the summary
file for any failures and fires off an email if so.

Probably a little brittle and maybe error prone but it seems to work.
_______________________________________________
Dirvish mailing list
[email protected]
http://www.dirvish.org/mailman/listinfo/dirvish

Reply via email to