[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

getting emails from cron despite redirecting output to a log file



Hello,

I have configured mrtg to log network traffic for our organization. This is working nicely except at some point while I was fiddling with the scripts under /etc/cron.d, which run every 5 minutes to collect snmp data I started getting emails to root from cron. I have stared at this and googled a bit... yes even the man page, but I don't see what I have messed up here:

 if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg/rm_127_switch-mrtg.cfg ] ; then env LANG=C /usr/bin/mrtg /etc/mrtg/rm_127_switch-mrtg.cfg 2>&1 | tee -a /var/log/mrtg/mrtg.log ; fi

To clarify the above is not the whole line from the file under /etc/cron.d/. I don't have access to that system right now so I am just posting the command part that I keep getting in my email.

Also, I have jobs for a few different switches setup like this. Is there any reason I can't let the output all go into the same log file? Hmmm... Wonder if it's a problem that all these jobs are trying to write to the same log file at once?

Ok. I think I know the next thing I am going to try, but I would sure welcome your thoughts.

Have a great day!
David


Reply to: