anacron and sending email updates

I have several RHEL6 systems which I need to run a script daily.  I created the script and placed it in /etc/cron.daily/ to be run by anacron.  

In the script most of the standard output if redirected to a file.  This file is then emailed to me in the script.

What is happening is it looks like anacron is stealing the output.  The output is emailed to me by anacron with a subject of "Anacron job 'cron.daily' on <hostname>".  But the email line in my script just sends me a blank email.  

If I run the script manually, it works perfect.

Any ideas?
LVL 23
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Check so you have full paths in the cronjob script to all files.
Gerwin Jansen, EE MVETopic Advisor Commented:
>> most of the standard output if redirected to a file
Check that other commands do not create any output. Redirect using >/dev/null if necesssary.

Output that is not redirected or 'removed' using /dev/null will cause emails being sent to you by cron

If you can't fix or find it, feel free to post a (redacted if needed) part of the script so we can help you out.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
savoneAuthor Commented:
I changed it so all output is redirected, is there a way to test it without waiting for anacron to run tomorrow?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Gerwin Jansen, EE MVETopic Advisor Commented:
Well I don't use anacron myself (just cron) but you could try and adding (or changing) a line in /etc/cron.d/anacron that determines when anacron jobs can are started:


(set it to your timezone's next hour)
savoneAuthor Commented:
Ok, all my jobs ran last night.  I still received emails from anacron although they now say "Null message body, hopes thats ok!!"

Also, the script manually sends an email, which comes through as blank.  If I run the script manually the email is sent fine.  Almost like anacron is stripping the redirect into mail.
Gerwin Jansen, EE MVETopic Advisor Commented:
Can you post the (redacted) script?
Is the script executable and has full interpreter path inside?
Gerwin Jansen, EE MVETopic Advisor Commented:
@gheist - the script runs manually, this implies that it is executable and the full path question was in the first comment ;)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.