![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Transferring hidden files with scp | matrixmadhan | UNIX for Dummies Questions & Answers | 13 | 01-16-2007 12:00 PM |
| Error transferring large file using sftp protocol | prashant.patel | Shell Programming and Scripting | 0 | 09-07-2006 02:49 PM |
| transferring files using ftp but mantaining the dates | 435 Gavea | Shell Programming and Scripting | 4 | 07-23-2006 08:48 AM |
| transferring files to and from remote computer | yogi1 | UNIX for Dummies Questions & Answers | 6 | 05-28-2006 06:58 PM |
| FTP session expiring when transferring files... Need some solution | aarora_98 | Shell Programming and Scripting | 4 | 12-13-2005 09:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
FTP - To handle error while transferring files
Hi,
I had written an FTP script where in I loop through the directories and transfer the files from each and every directory of Windows to UNIX. Now the problem is when 1. The connection is unable to be established I should return some error codes 2. When there is some system problem and the FTP doesnt happen also the error condition should be handled I would like to know whether there are any ways to handle the error codes for all the above conditions. I am currently modified the code to handle the problem like this in the following ways. ftp -v -n -i ${IP_ADDRESS} <<==eoftp== >> $LOGFILE 2>&1 user ${USERID} ${PASSWORD} lcd ${1} cd ${2} put ${3} bye ==eoftp== ret_val=$? echo "After ftp: `date '+%d/%m/%Y %T'`" |tee -a $LOGFILE 2>&1 echo "ret_val..= ${ret_val}" |tee -a $LOGFILE 2>&1 if [[ ${ret_val} -ne 0 ]] then echo "FTP failed..." |tee -a $LOGFILE 2>&1 else echo "FTP Successful..." | tee -a $LOGFILE 2>&1 fi Do let me know the other codes to be checked for proper functionality with check for exceptions Thanks Mahalakshmi.A |
| Forum Sponsor | ||
|
|