1
votes

I have a Perl script that uses Carp (carp croak) to print info and errors. When run directly I can see the output on console. But when I am running the script as cronjob I dont know where the messages are going.

Already checked in /var/log/messages /var/log/cron . Not found

Please help.

2
I did go through that before but I could not find the logs at mentioned locations in there... Like I have told above.... Also the link talks about directing output to some file or stream. I want to know where it goes by default. - Twaha Mehmood
Can you add your crontab file to the question? Also, what version of *nix are you using? Perhaps your /etc/crontab file. Anything to help diagnose. - dave

2 Answers

0
votes

man cron:

When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Job output can also be sent to syslog by using the -s option.

0
votes

I think you should redirect the stdout in your cronjob.