<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ftp error trapping in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775411#M942671</link>
    <description>How about this one ..,&lt;BR /&gt;&lt;BR /&gt;ftp&lt;BR /&gt;.....&lt;BR /&gt;......&lt;BR /&gt;EndFTP&lt;BR /&gt;&lt;BR /&gt;echo "Ftp Status :$?"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Will it help you out?</description>
    <pubDate>Tue, 30 Jul 2002 18:12:20 GMT</pubDate>
    <dc:creator>nanthakishore</dc:creator>
    <dc:date>2002-07-30T18:12:20Z</dc:date>
    <item>
      <title>ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775401#M942661</link>
      <description>I have a shell script that performs an interactive ftp session.&lt;BR /&gt;&lt;BR /&gt;How can I trap errors if the ftp aborts due to the network going down or the local disk/volume fills up ?&lt;BR /&gt;&lt;BR /&gt;Any help appreciated&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Tue, 30 Jul 2002 08:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775401#M942661</guid>
      <dc:creator>Andrew Briggs_1</dc:creator>
      <dc:date>2002-07-30T08:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775402#M942662</link>
      <description>We use the -v option on ftp so we can verbose output then direct all output and errors from the ftp script to a file, then grep for certain errors in that, eg;&lt;BR /&gt;&lt;BR /&gt;ftp -v &lt;HOST&gt; &amp;lt;&lt;EOF&gt;/tmp/tempfile 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;LOGIN&gt;&lt;BR /&gt;&lt;PUT file="" etc.=""&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Then check the contents of /tmp/tempfile to see if it worked or any errors.&lt;BR /&gt;&lt;/PUT&gt;&lt;/LOGIN&gt;&lt;/EOF&gt;&lt;/HOST&gt;</description>
      <pubDate>Tue, 30 Jul 2002 09:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775402#M942662</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-07-30T09:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775403#M942663</link>
      <description>Stefan,&lt;BR /&gt;&lt;BR /&gt;Thanks for that, I'll give it go and let you know.&lt;BR /&gt;&lt;BR /&gt;Do you know if there a list of all the verbose messages for the different errors that may occur. ?&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Tue, 30 Jul 2002 09:17:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775403#M942663</guid>
      <dc:creator>Andrew Briggs_1</dc:creator>
      <dc:date>2002-07-30T09:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775404#M942664</link>
      <description>FTP works using 3-digit error codes, which are normally displayed on the screen (or to a log)&lt;BR /&gt;&lt;BR /&gt;ftp server1&lt;BR /&gt;Connected to server1&lt;BR /&gt;220 server1 FTP server &lt;BR /&gt;Name (server1:chris):&lt;BR /&gt;331 Password required for chris.&lt;BR /&gt;Password:&lt;BR /&gt;230 User chris logged in.&lt;BR /&gt;&lt;BR /&gt;Where &lt;BR /&gt;&lt;BR /&gt;1st digit&lt;BR /&gt;&lt;BR /&gt;1 FTP request initiated ... waiting for reply ACKNOWLEDGE&lt;BR /&gt;2 FTP action completed ... waiting for new REQUEST&lt;BR /&gt;3 FTP command accepted ... waiting for more INFORMATION&lt;BR /&gt;4 FTP command rejected ... waiting for command RE-ISSUE&lt;BR /&gt;5 FTP command rejected ... waiting for new REQUEST&lt;BR /&gt; &lt;BR /&gt;second digit&lt;BR /&gt; &lt;BR /&gt;1 FTP in reply to request for info&lt;BR /&gt;2 FTP requested info on control and data connection&lt;BR /&gt;      network or ftp server is out of operation&lt;BR /&gt;3 FTP invalid reply to login or accounting authentication&lt;BR /&gt;      login or netrc not setup or has been altered&lt;BR /&gt;4 FTP code 4 not used&lt;BR /&gt;5 FTP requested info on server file system status&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3rd digit - further qualifier for 2nd digit (don't have details for this but mostly 0).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So, for example you fail to login, you receive&lt;BR /&gt;&lt;BR /&gt;530 Login incorrect.&lt;BR /&gt;&lt;BR /&gt;and if your network connection drops (or is killed) &lt;BR /&gt;&lt;BR /&gt;421 Service not available, remote server has closed connection&lt;BR /&gt;&lt;BR /&gt;Normally, the best way to trap these errors is (as Stefan said) to log the connection details, and to use the log for error checking.&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 30 Jul 2002 09:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775404#M942664</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2002-07-30T09:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775405#M942665</link>
      <description>&lt;BR /&gt;Andy,&lt;BR /&gt;&lt;BR /&gt;I dont think there is a master list of ftp errors - so many different things could cause different errors from;&lt;BR /&gt;invalid username/password&lt;BR /&gt;cant connect to server&lt;BR /&gt;ftp simply hangs - eventually timesout (network problem or destination server hung)&lt;BR /&gt;remote directory full&lt;BR /&gt;permission error on source file or writing to destination&lt;BR /&gt;filename already exists on remote&lt;BR /&gt;cant change to dir &lt;BR /&gt;etc etc. &lt;BR /&gt;You could either create some of these events yourself to see the error message generated or run if for a while and monitor and you will slowly pickup all the major types of errors you encounter.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jul 2002 09:44:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775405#M942665</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-07-30T09:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775406#M942666</link>
      <description>If you know Perl, there is a PERL::FTP module that will do stuff like this as well.&lt;BR /&gt;&lt;BR /&gt;I don't know Perl so I can't give any real details, but this would be an option for you as well.</description>
      <pubDate>Tue, 30 Jul 2002 09:46:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775406#M942666</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-07-30T09:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775407#M942667</link>
      <description>I forgot to mention, the ftpd man page contains more details on the error codes (this does not list the 3rd digits, although in most cases, these are not necessary, and the cause of the error can be found from the first 2).&lt;BR /&gt;&lt;BR /&gt;chris</description>
      <pubDate>Tue, 30 Jul 2002 09:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775407#M942667</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2002-07-30T09:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775408#M942668</link>
      <description>Thanks for all the help.&lt;BR /&gt;&lt;BR /&gt;I was logging the output and "grepping" already but wanted to know if there was a more elegant and robust way of trapping the error. You've all confirmed what I suspected. Chris's help re: the breakdown of the error messages is very helpful. I didn't think to man on ftpd but only looked at ftp. I'd guessed that a Perl implementation of ftp would be better but I cannot use that as an option.&lt;BR /&gt;&lt;BR /&gt;I've tried to emulate all the failures during tests so I can capture the output and then use this in my script to check for errors.&lt;BR /&gt;&lt;BR /&gt;Many Thanks to you all&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Tue, 30 Jul 2002 11:33:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775408#M942668</guid>
      <dc:creator>Andrew Briggs_1</dc:creator>
      <dc:date>2002-07-30T11:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775409#M942669</link>
      <description>ck=`cksum $FILENAME`&lt;BR /&gt;before_ftp_cksum=`echo $ck | awk ' { print $1 }'`&lt;BR /&gt;&lt;BR /&gt;ftp -nv ${FTPSITE}&amp;gt;&amp;gt; $LOGFILE &amp;lt;&lt;ENDFTP&gt;&lt;/ENDFTP&gt;user xxxxx yyyyy&lt;BR /&gt;prompt&lt;BR /&gt;cd $PROCDIR&lt;BR /&gt;mput $FILENAME&lt;BR /&gt;EndFTP&lt;BR /&gt;&lt;BR /&gt;ck=`rsh -l xxxxx $FTPSITE cksum $PROCDIR/$FILENAME`&lt;BR /&gt;after_ftp_cksum=`echo $ck | awk ' { print $1 }'`&lt;BR /&gt;&lt;BR /&gt;if [ $before_ftp_cksum -eq $after_ftp_cksum ]&lt;BR /&gt;then&lt;BR /&gt;  echo "files moved to $FTPSITE  status:$?" &amp;gt;&amp;gt;$LOGFILE&lt;BR /&gt;else&lt;BR /&gt;  echo "Problem in FTP status:$?" &amp;gt;&amp;gt;$LOGFILE&lt;BR /&gt;&lt;BR /&gt;I hope this script will help you out.</description>
      <pubDate>Tue, 30 Jul 2002 14:17:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775409#M942669</guid>
      <dc:creator>nanthakishore</dc:creator>
      <dc:date>2002-07-30T14:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775410#M942670</link>
      <description>Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;I realise that a checksum at both ends would provide the best validation of a successful transmission but my remote systems are not just HP-UX. They are Mainframe OS/390, NT, Windows 2000 all of which are not running any Unix shell environment.&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Tue, 30 Jul 2002 14:21:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775410#M942670</guid>
      <dc:creator>Andrew Briggs_1</dc:creator>
      <dc:date>2002-07-30T14:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: ftp error trapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775411#M942671</link>
      <description>How about this one ..,&lt;BR /&gt;&lt;BR /&gt;ftp&lt;BR /&gt;.....&lt;BR /&gt;......&lt;BR /&gt;EndFTP&lt;BR /&gt;&lt;BR /&gt;echo "Ftp Status :$?"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Will it help you out?</description>
      <pubDate>Tue, 30 Jul 2002 18:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-error-trapping/m-p/2775411#M942671</guid>
      <dc:creator>nanthakishore</dc:creator>
      <dc:date>2002-07-30T18:12:20Z</dc:date>
    </item>
  </channel>
</rss>

