Link to home
Start Free TrialLog in
Avatar of funnymanmike
funnymanmikeFlag for Canada

asked on

how can i see what cron jobs failed in solaris

1) im pretty new at this unix stuff

i have a list of cron jobs that are saposed to run every night

how can i tell what cron jobs failed? is there a log somewhere

Thanks
SOLUTION
Avatar of ittogo
ittogo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of woolmilkporc
Hi,

add
MAILTO=[user@domain.tld]
at the top of your crontab.
Should your jobs produce any output on stdout or stderr, the above user will receive those data per mail.

wmp

by the way solaris crontab does not support

MAILTO=user@domain

and crontab jobs output is sent to user's mailbox

You may check /var/cron/log as ittogo mentioned and you can redirect stdout and stderr to files e.g.

* * * * * /path/to/script > /path/to/script.log 2>&1
Avatar of funnymanmike

ASKER

Thanks ittogo:

i can see two scripts setup to run in the cron log

5 3 * * * csh /opt/davox/trs/scrx/pday_roll 1>/dev/null 2>&1
5 5 * * * csh /opt/davox/custom/scrx/crt_prvs_dy_camps.script 1>/dev/null 2>&1

but how the hell do i read this log, where can i see if there is an error

>  CMD: csh /opt/davox/trs/scrx/pday_roll 1>/dev/null 2>&1
>  davox 23074 c Tue Jan 20 03:05:00 2009
>  CMD: /usr/sbin/logadm
>  root 25511 c Tue Jan 20 03:10:00 2009
<  root 25511 c Tue Jan 20 03:10:01 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 26065 c Tue Jan 20 03:15:00 2009
<  davox 26065 c Tue Jan 20 03:15:01 2009
>  CMD: [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
>  root 26168 c Tue Jan 20 03:30:00 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 26169 c Tue Jan 20 03:30:00 2009
<  root 26168 c Tue Jan 20 03:30:00 2009
<  davox 26169 c Tue Jan 20 03:30:01 2009
<  davox 23074 c Tue Jan 20 03:43:02 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29188 c Tue Jan 20 03:45:00 2009
<  davox 29188 c Tue Jan 20 03:45:01 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29256 c Tue Jan 20 04:00:00 2009
<  davox 29256 c Tue Jan 20 04:00:02 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29295 c Tue Jan 20 04:15:00 2009
<  davox 29295 c Tue Jan 20 04:15:01 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29336 c Tue Jan 20 04:30:00 2009
<  davox 29336 c Tue Jan 20 04:30:01 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29376 c Tue Jan 20 04:45:00 2009
<  davox 29376 c Tue Jan 20 04:45:01 2009 rc=1
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29410 c Tue Jan 20 05:00:00 2009
<  davox 29410 c Tue Jan 20 05:00:02 2009
>  CMD: csh /opt/davox/custom/scrx/crt_prvs_dy_camps.script 1>/dev/null 2>&1
>  davox 29446 c Tue Jan 20 05:05:00 2009
<  davox 29446 c Tue Jan 20 05:13:47 2009
>  CMD: csh /opt/davox/trs/scrx/trs_raid 1>/dev/null 2>&1
>  davox 29470 c Tue Jan 20 05:15:00 2009
<  davox 29470 c Tue Jan 20 05:15:01 2009
>  CMD: csh /opt/davox/custom/scrx/check_dload_file 1>/dev/null 2>&1
>  davox 29506 c Tue Jan 20 05:20:00 2009

im a windows guy, and i just don't get it
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ittogo > simple answer, got the job done
Tintin > excellent explaination, gave me understanding

thanks all