Cron output not getting saved

cron

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?

Best Answer

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.

Related Topic