Kenneth Pronovici wrote:
It's sometimes difficult to distinguish between output from the
different jobs run as part of cron.daily.
...
It would be great if run-parts could visually distinguish between output
from each job that is run.  Possible options include a blank line
between jobs, a ruler (----, ====) between jobs

I haven't looked at the source to run-parts yet (when did it cease being a shell script?), but I suspect implementing the above suggestion would be less trivial than you expect. run-parts probably doesn't involve itself in managing the output of the jobs it runs, and therefore it doesn't know if a job has produced any output. If run-parts outputs a separator between two jobs that produced no output, then in the typical cron or anacron context, the user will get a useless email.

The usual remedy for this is to use temp files for each job, but that has down sides and developers generally try and avoid it.

What I'd like to see happen in run-parts is even more disruptive. I'd like to see a command line option that causes run-parts to output an email message for each job, if there is any output from that job. Essentially, run-parts would take over the cron/anacron output management duty. (Seeing as run-parts is now ported to C, perhaps the output management could could be lifted wholesale from cron or anacron.)

I'd also like to see some mechanism by which the jobs can specify a message subject, and perhaps the recipient address, mirroring the way you can control that behavior of cron through variables in the crontab. But I'm not sure how that info could get communicated easily. (Have the job output headers to a specified file descriptor (say #3), which run-parts would be listening on, and use that to initialize the message header. Or have a per-job config file? job.conf)

 -Tom



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to