![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cron job starts new cron proccess | ron76 | SUN Solaris | 3 | 05-12-2008 01:07 AM |
| filtering the logs | prvnrk | Shell Programming and Scripting | 5 | 04-08-2008 09:57 PM |
| Cron and Pseudo-Cron | dingusmcghee | UNIX for Dummies Questions & Answers | 1 | 01-31-2008 12:58 PM |
| CRON usage for CRON job | skyineyes | UNIX for Dummies Questions & Answers | 1 | 01-17-2008 10:17 AM |
| /etc/cronlog.conf not working | chosie | AIX | 4 | 05-31-2005 04:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi,
I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool exists that will do this for me? If not I was thinking this could be a nice tool to use 'awk,' but I am not the best at 'awk.' I'm just a hack. My current filter* only sends me logs when I have errors but it gives me the full set of data at that time, and I have to search for Fail. I copy my file to a tmp and clean up when done. Then I have my rotation set just rigt so I do not spam myself with dup data. PS I have read man for the cron/crontab commands + others and have not seen anything like this yet. tia Keith * cronfile="/var/adm/cron/log" tmp="/tmp/cron.tmp.log" # COPY CRON FILE LOG TO TEMP TO SEND IN EMAIL LATER cp -p $cronfile $tmp #FILTER if [[ $(cat $tmp | grep Fail | wc -l) > "1" ]] then subject=$(print "Daily cron log $(date)" | tr ' ' '-') uuencode $tmp $tmp | mail -s $subject $USER < $tmp #end filter fi sleep 5;[[ -e $tmp ]] && rm $tmp Last edited by Keith Johnson; 01-10-2008 at 11:37 AM.. |
| Sponsored Links | ||
|