![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New User/Mail setup question. PLEASE help. | Rotting | UNIX for Dummies Questions & Answers | 3 | 09-27-2007 03:19 AM |
| mail question here | lostinfaith | UNIX for Dummies Questions & Answers | 1 | 05-12-2006 11:42 AM |
| question on mail server | piltrafa | UNIX for Dummies Questions & Answers | 1 | 07-26-2005 12:12 PM |
| Mail question? | yxiao | UNIX for Dummies Questions & Answers | 2 | 10-15-2002 07:53 AM |
| MAIL question for HP-Unix O/S | dsthompson | How do I send email? | 3 | 03-26-2002 07:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
well if an error occurs on any of the scp i dont want my file successfull command to run and create a log file. That is what i was trying to say so thought to write an if statement and it only executes if the other 2 if statements pass.
|
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
see if this what you are looking for
Quote:
scp1=0 scp2=0 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 if [ $? != 0 ]; then echo "error occurred" mailx -s "Subject" "abc@abc.com" <<-EOT scp failed `date` EOT scp1=1 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 scp2=1 fi if [ scp1 = 0 ]; then echo "First SCP successful" >> $LOCAL_LOG_FILE fi if [ scp2 = 0 ]; then echo "Second SCP successful" >> $LOCAL_LOG_FILE fi |
|
#10
|
|||
|
|||
|
Thanks alot rakesh.
|
|||
| Google The UNIX and Linux Forums |