![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check sqlplus command is successfull or not in HP UX? | plaban.rout | HP-UX | 5 | 11-20-2007 06:48 AM |
| Detecting a key combination | mobile01 | High Level Programming | 11 | 12-22-2006 09:46 AM |
| Not detecting CD ROm drive | sbasetty | Gentoo | 13 | 12-05-2006 11:00 AM |
| solaris 10 isnt detecting my internet connection | stride6 | SUN Solaris | 5 | 06-22-2006 05:08 AM |
| check for successfull telnet session | sumguy | UNIX for Dummies Questions & Answers | 0 | 05-15-2006 01:27 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Detecting a successfull FTP connection
I have a question. My company has to send a file to another company. The cron script currently just sends the file. However, every now and then the other companies ftp server is down. I wanted to alter my script to detect if the server is up before I attempt to send the file. My idea follows
# Check to see if xxx ftp application is working ftpResponse=`ftp -n -v XXX.XXX.XXX.XX < $GERS_HOME/adhoc/arcr/FTPCHK.ftp` #echo "$ftpResponse" ftpnum=`echo "$ftpResponse"|grep 230 | wc -c` #echo $ftpnum if [ $ftpnum -gt 0 ] ; then ..... fi The ftp sites IP number does not contain the number 230 . The current response from the server is below. Do you think that this would be a robust method or do you have a more robust method? Connected to XXX.XXX.XXX.X. 220 xxx_FTP1 331 Password required for XXXXXXX. 230 User XXXXXXX logged in. 221 Bye bye ... Meaning of the returned FTP codes. 220 Service ready for new user. 331 User name okay, need password. 230 User logged in, proceed. 221 Service closing control connection. Logged out if appropriate. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|