Quote:
Originally Posted by chris1234
Thanks dude. Well even if there is an error in any one of the SCP my log file is still generated. So i thought to add an if statement if the test pass then only log it .
Code:
if [ $? >= 0]; then
echo "File Transfer Successful"
mailx -s "Scp Passed Successful" "suleman.zia@autozone.com" <<-EOT
All the files havve been transfered successfully
`date
EOT
echo "File copied Successfully `date +%n%m/%d/%Y%n%H:%M:%S`" >>$LOCAL_LOG_FILE
fi
|
you are sending success message on error...think it is wrong
if [ $? -ge 0 ]; then
means if there is an error