1834732 Members
3655 Online
110070 Solutions
New Discussion

Does Crontab have a log?

 
David White
Occasional Contributor

Does Crontab have a log?

Sorry for such a trivial question(I'm a Trainee Unix Admin), but does Crontab have a log where I can see why a job failed?

thanks

Dave
It's a laugh - innit?!?!?
7 REPLIES 7
Rainer_1
Honored Contributor

Re: Does Crontab have a log?

The logfile is /var/adm/cron/log
If anything from a cron job comes to stdout or stderr you get a mail for root.
federico_3
Honored Contributor

Re: Does Crontab have a log?

the crontab log is:
/var/adm/cron/log


federico
Carlos Fernandez Riera
Honored Contributor

Re: Does Crontab have a log?


Cron log is on /usr/lib/cron/log

Unless you use redirection of standard output and error on your cron

1 * * * * * command > /tmp/log 2>&1

all output is redirected to users mail.

unsupported
CHRIS_ANORUO
Honored Contributor

Re: Does Crontab have a log?

THE CRONTAB HAS A LOG IN /VAR/ADM/CRON/LOG AND FOR FAILED MESSAGES, A MAIL IS SENT OT ROOT. LOG IN AS ROOT AND TYPE MAILX TO READ THE MAILS.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
f. halili
Trusted Contributor

Re: Does Crontab have a log?

Cron has a log file which is :

/var/adm/cron/log

- fnhalili
derekh
Dan Hetzel
Honored Contributor

Re: Does Crontab have a log?

Hi,

All cron jobs are logged to /var/adm/cron/log, unless they are specifically redirected both dtdin and stderr. (like in >/tmp/mylog 2>&1)

In other words, all character stream that would normally show up on a terminal if the job was run manually, will be in that logfile.

Dan

Dan
?
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Josee Bourget-Thuma
Frequent Advisor

Re: Does Crontab have a log?

I prefer to read the mail sent to ROOT by reading the file in /var/mail/root. I monitor all files in /var/mail for size. You can mail this /var/mail/root file to yourself daily to help you remember to check it.

Have fun!
Josee
Failure is not an option.