[clue] tee in cronjob

Quentin Hartman qhartman at gmail.com
Tue May 20 08:34:25 MDT 2014


I came to this same conclusion after thinking about this some more
yesterday. It makes perfect sense that cron would buffer the output until
the process it sees as creating it had ended. I was having a "forest for
the trees" moment. Since the error states that create messages happen so
far apart I was wrongly thinking of them as different invocations, even
though I knew they weren't.

QH


On Mon, May 19, 2014 at 6:07 PM, David L. Anselmi <anselmi at anselmi.us>wrote:

> Quentin Hartman wrote:
> >
> > Interestingly, all of the "tee" output seems to be buffered until cron
> > kills the script or the script dies for some other reason.
>
> So you mean the stdout data that cron emails you?
>
> So (for Vixie cron anyway) "any  output  is  mailed  to  the  owner".
>  You'd expect that to be one
> email, right?  Not one per line or some other subset.  So the mail can't
> be sent until the script ends.
>
> The behavior you see is because your script runs for a really long time.
>  I don't think the while
> has anything to do with it.  Does that make sense?
>
> If you want more mail, the answer is to send mail yourself.
>
> If you want mail for each error you break the loop, send the mail, and go
> back to looping again.
>
> If you want mail for each loop, you send the mail as part of your commands.
>
> Or, if you know you're running every minute (or 5, or ...), take out the
> loop and schedule the cron
> appropriately.  And only produce output for cases where you want a mail.
>
> Dave
> _______________________________________________
> clue mailing list: clue at cluedenver.org
> For information, account preferences, or to unsubscribe see:
> http://cluedenver.org/mailman/listinfo/clue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20140520/bed213d1/attachment-0001.html 


More information about the clue mailing list