[colug-432] Where do cron jobs store their generated stdout while running?

Travis Sidelinger travis at ilive4code.net
Tue Feb 9 22:42:04 EST 2010


Actually you should capture the output yourself to your own log files.  
The idea behind cron emailing the output is that the job should only 
send an email when something didn't work correctly.  A clean job should 
have zero output.

Example cron job:

0 0 * * *  root /path/to/my/script 1>> /var/log/job.log           # 
capture only stdout
1 0 * * *  root /path/to/my/script2 1>> /var/log/job2.log 2>&1    # 
capture both stdout and stderr

Remember to add a logrotation rule if needed.


On 02/09/2010 10:19 PM, Rob Stampfli wrote:
> A stupid question, the answer of which has proved to be more elusive
> than I would have first thought:  When a cron job completes, its stdout
> and stderr are emailed to the user running the job.  I have a job
> that runs for a prolonged period of time and for which I'd occasionally
> like to review its output while it is in progress, but I can't figure
> out where to look for it.  The executable itself is sending its output
> to a pipe.  There appears to be no file in /tmp or /var/tmp that is
> accumulating this data, but it must be stored somewhere until the job
> completes.  Anyone know where?
>
> FWIW, I'm running Ubuntu 9.04 (on an ARM processor, not that I believe
> that the hardware is germane to this query).
>
> Thanks in advance,
> Rob
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
>    



More information about the colug-432 mailing list