<?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 Errors in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782688#M833201</link>
    <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;The PERL answer looks great but I am a little confused on how to install a module. Can you tell me the steps involved in loading  this Net::FTP module?&lt;BR /&gt;&lt;BR /&gt;Thanks, Greg</description>
    <pubDate>Thu, 08 Aug 2002 20:42:58 GMT</pubDate>
    <dc:creator>Greg White</dc:creator>
    <dc:date>2002-08-08T20:42:58Z</dc:date>
    <item>
      <title>FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782685#M833198</link>
      <description>Hello Experts,&lt;BR /&gt;&lt;BR /&gt;One of my customers FTP's a few files weekly to another location. Usually my script works fine but every now and then one of the file transfers does not complete. I can't seem to find a way to get the FTP status code into any useful form. I would like to re-transmit the file if an error occurs. Any ideas out there?&lt;BR /&gt;&lt;BR /&gt;Thanks, Greg&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Aug 2002 19:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782685#M833198</guid>
      <dc:creator>Greg White</dc:creator>
      <dc:date>2002-08-08T19:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782686#M833199</link>
      <description>The way I have done this in the past is to send ALL of the output to a logfile, I think the -v option to FTP, and then look for the "Transfer complete" (or whatever the message is) and if it is not there, generate an error and you can try again.&lt;BR /&gt;&lt;BR /&gt;An easier way to do this is with the NET::FTP PERL module.  This apparently has all kinds of error checking built in, so if you know PERL that would probably be your best bet.</description>
      <pubDate>Thu, 08 Aug 2002 19:55:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782686#M833199</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-08-08T19:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782687#M833200</link>
      <description>Hi Greg:&lt;BR /&gt;&lt;BR /&gt;I might as well make you bad right off the bat. If you are using some silly scripting other than Perl (specifically the Net::FTP module), you are doing it the hard way. You will need to download and install the module from &lt;A href="http://www.CPAN.org" target="_blank"&gt;www.CPAN.org&lt;/A&gt; but after that this is really easy. I already have a script that should be very close. Modify the remote host name, login, and passwd and you are ready to rumble.&lt;BR /&gt;&lt;BR /&gt;FILES="file1 file2 file3"&lt;BR /&gt;for F in ${FILES}&lt;BR /&gt;  do&lt;BR /&gt;     ftp.pl ${F}&lt;BR /&gt;     STAT=${?}&lt;BR /&gt;     echo "File: ${F} Result: ${STAT}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;you could also simply&lt;BR /&gt;ftp.pl ${FILES}&lt;BR /&gt;STAT=${?} &lt;BR /&gt;to do them all in one shot. 0 means all is well.&lt;BR /&gt;&lt;BR /&gt;2 actually means OK to FTP but that is translated to a zero by the script. You get FTP error checking for free using the Net::FTP&lt;BR /&gt;module. &lt;BR /&gt;&lt;BR /&gt;Now throw away your dumb shell scripts and do it the smart way.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Aug 2002 19:57:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782687#M833200</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-08T19:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782688#M833201</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;The PERL answer looks great but I am a little confused on how to install a module. Can you tell me the steps involved in loading  this Net::FTP module?&lt;BR /&gt;&lt;BR /&gt;Thanks, Greg</description>
      <pubDate>Thu, 08 Aug 2002 20:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782688#M833201</guid>
      <dc:creator>Greg White</dc:creator>
      <dc:date>2002-08-08T20:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782689#M833202</link>
      <description>Hi Greg:&lt;BR /&gt;&lt;BR /&gt;Net::FTP is actually contained in libnet. I suggest that you download and install the library.&lt;BR /&gt;Use this link:&lt;BR /&gt;&lt;A href="http://search.cpan.org/search?dist=libnet" target="_blank"&gt;http://search.cpan.org/search?dist=libnet&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and click on the libnet-1.12.tar.gz link.&lt;BR /&gt;&lt;BR /&gt;This will download the source. You then gunzip it in a tmp directory and then untar the files.&lt;BR /&gt;Go to the libnet-1.12 directory directory underneath the directory in which you did the&lt;BR /&gt;tar. There will be a README file to guide you through the process. The first thing you will run is perl Makefile.PL. The rest is very, very simple. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Aug 2002 20:49:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782689#M833202</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-08T20:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782690#M833203</link>
      <description>Greg -&lt;BR /&gt;&lt;BR /&gt;here is how on Perl deprived rookie does it -&lt;BR /&gt;&lt;BR /&gt;ftp -n -v &amp;lt;&amp;lt; endl &amp;gt;&amp;gt; /$FTP_LOG  &lt;BR /&gt;open servername (or ip)                    &lt;BR /&gt;user username userpassword            &lt;BR /&gt;prompt                          &lt;BR /&gt;mput RC*                        &lt;BR /&gt;quit                            &lt;BR /&gt;endl                            &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep 'Not connected' $FTP_LOG 1&amp;gt;/dev/null 2&amp;gt;/dev/null    &lt;BR /&gt;echo $? | read RC                                        &lt;BR /&gt;grep 'full'  $FTP_LOG 1&amp;gt;/dev/null 2&amp;gt;/dev/null            &lt;BR /&gt;echo $? | read RC1                                       &lt;BR /&gt;grep 'fail'  $FTP_LOG 1&amp;gt;/dev/null 2&amp;gt;/dev/null            &lt;BR /&gt;echo $? | read RC2                                       &lt;BR /&gt;grep 'Error writing'  $FTP_LOG 1&amp;gt;/dev/null 2&amp;gt;/dev/null   &lt;BR /&gt;echo $? | read RC3                                       &lt;BR /&gt;&lt;BR /&gt;if [ $RC -lt 1 -o $RC1 -lt 1 -o $RC2 -lt 1 -o $RC3 -lt 1 ]&lt;BR /&gt;then &lt;BR /&gt; do something (i.e. sleep X amount of tine and resend)&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course, hard coding the user name and password are not done. A .netrc will preserve the security. Yhis is only an example. Output to /dev/null can be condensed as well.&lt;BR /&gt;In any event this is roughly how we handle ftp verification and email upon failures ("then do something".&lt;BR /&gt;&lt;BR /&gt;Best of luck.&lt;BR /&gt;Someday I will learn perl as well. Clay has some very good answers to a number of postings that require perl.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 08 Aug 2002 23:10:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782690#M833203</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-08-08T23:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782691#M833204</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I got the Net::FTP module installed and the PERL script worked great. They use anonymous FTP so all I had to do was to change the hostname and login and everything worked fine. Believe it or not, the very first time I used the script it detected an imcomplete transfer and automatically resent the file!&lt;BR /&gt;&lt;BR /&gt;Dave, thanks for your suggestion but after seeing this PERL script work there is no way I'm going to change. Besides who would want to make A. Clay bad (or mad)?&lt;BR /&gt;&lt;BR /&gt;I have got to learn PERL.&lt;BR /&gt;&lt;BR /&gt;Thanks, Greg</description>
      <pubDate>Fri, 09 Aug 2002 15:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782691#M833204</guid>
      <dc:creator>Greg White</dc:creator>
      <dc:date>2002-08-09T15:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Errors</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782692#M833205</link>
      <description>Hi Greg:&lt;BR /&gt;&lt;BR /&gt;I'm glad you are now a Perl convert. If you really want to be impressed by Perl, try writing a script that uses sockets. What I used to do in C now works in a scripting language and it just about as fast. I especially like the idea that I can write a sockets based client/server pair and have it work in the Windows world equally well and unchanged. &lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Aug 2002 15:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-errors/m-p/2782692#M833205</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-09T15:07:48Z</dc:date>
    </item>
  </channel>
</rss>

