<?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 scripting, in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559308#M918705</link>
    <description>Thanks to all for your answers,  &lt;BR /&gt;The script ftp is included in a .ksh. After the ftp, we have a program which should test the result of the transfer: the contents of the source and the destination. But when there are problems during the transfer, the connection is closed but we have an ftp without connection (equivalent of ftp &amp;gt; prompt with closed connection). We have the errors in a file which we read in a while and as soon as we have an error, we want let us stop the session and manage the end of the program. To do it, it is necessary to us to have the PID of the process FTP to be able to kill the process. The ftp is constructed dynamically and looks like :&lt;BR /&gt;&lt;BR /&gt;ftp -i -v -n server &lt;TOTO&gt;result  2&amp;gt; errors &lt;BR /&gt;&lt;BR /&gt;toto contains the commands ftp like : &lt;BR /&gt;user username password &lt;BR /&gt;cd ...&lt;BR /&gt;get ...&lt;BR /&gt;...&lt;BR /&gt;bye &lt;BR /&gt;&lt;BR /&gt;Suggestion ?&lt;BR /&gt;Nora&lt;/TOTO&gt;</description>
    <pubDate>Tue, 31 Jul 2001 20:17:35 GMT</pubDate>
    <dc:creator>Admin.SIF</dc:creator>
    <dc:date>2001-07-31T20:17:35Z</dc:date>
    <item>
      <title>ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559300#M918697</link>
      <description>Hi all,&lt;BR /&gt;How to get back the pid of a background process (script ftp) in a variable to follow it by program ? &lt;BR /&gt;We need to know the result of the ftp to continue because the session remains hung on even if it is inactive.&lt;BR /&gt;Thanks,&lt;BR /&gt;Nora</description>
      <pubDate>Tue, 31 Jul 2001 15:00:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559300#M918697</guid>
      <dc:creator>Admin.SIF</dc:creator>
      <dc:date>2001-07-31T15:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559301#M918698</link>
      <description>If I understand your question $! is the pid of the last background process.</description>
      <pubDate>Tue, 31 Jul 2001 15:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559301#M918698</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-07-31T15:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559302#M918699</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The 'ftp' session doesn't return an exit value denoting success or failure, and that can make scripting to find the success or failure of a session a bit of a pain.&lt;BR /&gt;&lt;BR /&gt;If you really want to decipher success/failure you can parse the three-digit numbers included with the reply from each ftp command.  To do this in an ftp script, you can redirect verbose output into a logfile and parse the replys.  See "man 1M ftpd" for a discussion of the format of the reply messages.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 31 Jul 2001 15:11:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559302#M918699</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-31T15:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559303#M918700</link>
      <description>Hello,&lt;BR /&gt;      Please Mr Clay correct me if I am wrong but if you do &lt;BR /&gt;#./script &amp;amp;&lt;BR /&gt;it gives you the pid when it is executed in the background. It gives me the same pid that &lt;BR /&gt;$! gives me. But the output says &lt;BR /&gt;sh: 27138:  not found. Is that what it is supposed to do ?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Tue, 31 Jul 2001 15:25:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559303#M918700</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-07-31T15:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559304#M918701</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;See this recent thread for a discussion of tracking background processes:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xfe7387dc4d7dd5118ff00090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xfe7387dc4d7dd5118ff00090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 31 Jul 2001 15:36:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559304#M918701</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-31T15:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559305#M918702</link>
      <description>once you send it to the Bg, use jobs -l to get the PID. you could sleep for 30 seconds or so to see if it is hung, and if so kill it.</description>
      <pubDate>Tue, 31 Jul 2001 15:46:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559305#M918702</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-07-31T15:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559306#M918703</link>
      <description>Hi Admin,&lt;BR /&gt;    I have solved my ftp problems with a script that I have &lt;BR /&gt;included with this reply. The server, user, and password are located in a file in /etc/local directory and is into the&lt;BR /&gt;script upon startup.&lt;BR /&gt;&lt;BR /&gt; Hope this helps</description>
      <pubDate>Tue, 31 Jul 2001 15:57:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559306#M918703</guid>
      <dc:creator>David W Damon</dc:creator>
      <dc:date>2001-07-31T15:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559307#M918704</link>
      <description>Hi Nora:&lt;BR /&gt;&lt;BR /&gt;When I have to do ftp scripting these days, I use perl with the Net::FTP module (available for download at &lt;A href="http://www.perl.org/CPAN)." target="_blank"&gt;www.perl.org/CPAN).&lt;/A&gt; It really makes FTP operations very simple. Any error conditions and timeouts are easy to test for and set. It you don't know perl, now would be a good time to learn.&lt;BR /&gt;&lt;BR /&gt;It's usually something as simple as this (with error checking omitted):&lt;BR /&gt;&lt;BR /&gt;use Net::FTP;&lt;BR /&gt;    &lt;BR /&gt;$ftp = Net::FTP-&amp;gt;new("remotehost.name", Debug =&amp;gt; 0);&lt;BR /&gt;$ftp-&amp;gt;login("anonymous",'cstephen@xxx.com');&lt;BR /&gt;$ftp-&amp;gt;cwd("/downloads");&lt;BR /&gt;$ftp-&amp;gt;get("testfile.txt");&lt;BR /&gt;$ftp-&amp;gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Tue, 31 Jul 2001 16:25:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559307#M918704</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-07-31T16:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559308#M918705</link>
      <description>Thanks to all for your answers,  &lt;BR /&gt;The script ftp is included in a .ksh. After the ftp, we have a program which should test the result of the transfer: the contents of the source and the destination. But when there are problems during the transfer, the connection is closed but we have an ftp without connection (equivalent of ftp &amp;gt; prompt with closed connection). We have the errors in a file which we read in a while and as soon as we have an error, we want let us stop the session and manage the end of the program. To do it, it is necessary to us to have the PID of the process FTP to be able to kill the process. The ftp is constructed dynamically and looks like :&lt;BR /&gt;&lt;BR /&gt;ftp -i -v -n server &lt;TOTO&gt;result  2&amp;gt; errors &lt;BR /&gt;&lt;BR /&gt;toto contains the commands ftp like : &lt;BR /&gt;user username password &lt;BR /&gt;cd ...&lt;BR /&gt;get ...&lt;BR /&gt;...&lt;BR /&gt;bye &lt;BR /&gt;&lt;BR /&gt;Suggestion ?&lt;BR /&gt;Nora&lt;/TOTO&gt;</description>
      <pubDate>Tue, 31 Jul 2001 20:17:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559308#M918705</guid>
      <dc:creator>Admin.SIF</dc:creator>
      <dc:date>2001-07-31T20:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting,</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559309#M918706</link>
      <description>Hello Nora,&lt;BR /&gt;&lt;BR /&gt;why don't you just issue the follwing line from within&lt;BR /&gt;your ftp-script:&lt;BR /&gt;   !echo $PPID &amp;gt; /tmp/fpt.pid&lt;BR /&gt;&lt;BR /&gt;Then you do have the PID available...&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;   Wodisch</description>
      <pubDate>Sat, 04 Aug 2001 14:51:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting/m-p/2559309#M918706</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-08-04T14:51:23Z</dc:date>
    </item>
  </channel>
</rss>

