|
try this -- but not tested
EXIT_STATUS="?"
LOCAL_LOG_FILE="category_`date +%m%d%Y`.log"
date +"%m/%d/%Y %H:%M:%S" >$LOCAL_LOG_FILE
scp -p /az/web/ezap.abc.com/docs/*.gif saloo:/az/web/vendornet.abc.com/docs/tester/bkup>$LOCAL_LOG_FILE 2>&1
if [ $? != 0 ]; then
echo "error occurred"
mailx -s "Subject" "abc@abc.com" <<-EOT
scp failed
`date`
EOT
fi
scp -p recon:/az/web/vendornet.abc.com/docs/tester/mike/priceops/*.txt audi:/az/web/ezap.abc.com/docs
if [ $? != 0 ]; then
echo "error occurred"
mailx -s "Subject" "abc@abc.com" <<-EOT
scp failed
`date`
EOT
fi
echo "File copied Successfully `date +%n%m/%d/%Y%n%H:%M:%S`" >>$LOCAL_LOG_FILE
find /home/test/bin -name 'category_[0-9][0-9]*.log' -atime +30 -exec 'rm' { } \;
|