Cron jobs seem to be running as I see this in my /var/log/cron

Nov  5 09:00:01 glumbo CROND[18740]: (root) CMD (cd /var/www/domain.com/cgi-bin;./cron.pl >/root/cron.log 2>&1)

However, no output is saved to /root/cron.log

When I run the same command (cd /var/www/domain.com/cgi-bin;./cron.pl >/root/cron.log 2>&1) at the command line I get output saved to /root/cron.log

What is happening?

  • cron has d different environment from your shell, have you double checked that you are setting PATH, and stuff in your script?
    – Zoredache
    Nov 5, 2011 at 7:45
  • Did you try running your script with the full path instead of doing a cd and the issuing ./cron.pl?
    – Axel Knauf
    Nov 5, 2011 at 15:51

2 Answers 2


My first guess would be that when the job is run in cron, it's not being run as root somehow, and thus can't write to /root/cron.log. Check that and check the permissions on /root/cron.log.

Also, exactly what does 'cron.pl' do? Anything useful in /var/log/messages?

Try replacing the call to cron.pl with a simple 'echo' statement, then see if that is ending up in /root/cron.log.

  • It says root in the line I pasted in the question. cron.log is set to 666. Cron.pl checks a database to delete entries and then prints the number of entries deleted. Nothing in var/log/messages Nov 5, 2011 at 6:46

I've never liked stacking commands in cron -- it's almost always cleaner to have a wrapper script, and call that from cron.

I'm guessing that it's failing for some reason, and it's generating output which is being sent to mail, and either the mail's misconfigured and not being delivered, load's too high and mail delivery is suspended, root's mail is being forwarded elsewhere, or you haven't looked through root's mailbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.