The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 02-05-2007
goodmis goodmis is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 24
Thanks funsen,

I am confused as to how it fits together.

I can see running the cron job and writing standard error to a temp file on the cron job.

2> /tmp/file

What I don't understand when not to fire the awk script if there is an error.


var=$(wc -l /tmp/file)
if [ $var -gt 0 ] then cat /tmp/file | mail -s "copy job error" your@e.mail; rm
/tmp/file; fi


Thanks again for replying