<div dir="auto"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Feb 17, 2017 06:39, "Chris Green" <<a href="mailto:cl@isbd.net">cl@isbd.net</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Feb 17, 2017 at 06:24:10AM -0600, W Scott Lockwood III wrote:<br>
<div class="elided-text">> On Feb 17, 2017 06:14, "Chris Green" <[1]<a href="mailto:cl@isbd.net">cl@isbd.net</a>> wrote:<br>
><br>
> No use, I want an *ordinary* cron job to identify itself.<br>
> E.g. I have backup jobs running on one of my headless computers with<br>
> cron entries like:-<br>
> 20 1 * * * rsync -a --exclude '*.pyc' /home/chris/<br>
> isbd.uk:.syncmisc/odin/<br>
> When something goes wrong I want to be able to identify where the<br>
> mail<br>
> from cron came from.<br>
><br>
> Wrap that cron in a script. Have the script echo the identifier of your<br>
> choice before it does anything else.<br>
> echo "This cron is running on Fred, the RPI system providing DNS and<br>
> DHCP. It lives under your couch."<br>
> Or something similar.<br>
><br>
</div>I suppose one could do that, but I don't want E-Mails *except* when<br>
there's an error which would make the wrapper script rather<br>
complicated.<br>
<br>
Surely this is a fairly common problem and there must be a reasonably<br>
simple solution.</blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif"> But your example cron will send an email with every run as it is now. A wrapper script is no different, except you can further refine it by adding logic to also handle sending email only if there is an error. cron does not do this at all. Yes, you are going to have to write code.</span><br></div><div class="gmail_extra" dir="auto"></div></div>