Something More Than Cron
Eric Wald
eswald at brainshell.org
Sat Feb 13 08:18:19 MST 2010
Shane Hathaway wrote:
> I'd like some suggestions for Unix/Linux software that does just a bit
> more than our old standby, cron. I'd like:
>
> - A complete report of what was run and when (cron doesn't do this)
>
> - An email even if the job takes a long time (cron apparently doesn't
> send email if the job takes more than 5 minutes)
Could these two be added by a simple wrapper around your real cron job?
It could start by adding a single line to a log file, then steal all of
the input and pipe it into sendmail. Rough guideline:
echo `date -u +"%s"` "$@" >> /var/log/jobsrun.log
( echo "From: $0 at localhost"; \
echo "To: $USER at localhost";
echo "Subject: Job transcript for $1";
echo; \
"$@" ) |& sendmail -i $USER at localhost
Good luck.
- Eric
More information about the PLUG
mailing list