<?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 Question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860454#M95985</link>
    <description>I use the following to push out the hosts file&lt;BR /&gt;any time I need to update it&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/ksh&lt;BR /&gt;for x in `more /home/root/list`&lt;BR /&gt;do&lt;BR /&gt; echo CONNECTING TO $x&lt;BR /&gt; ftp -n &amp;lt;&amp;lt;-EOF&lt;BR /&gt;        open $x&lt;BR /&gt; user &lt;USER&gt; &lt;PASSWORD&gt;&lt;BR /&gt; cd /etc&lt;BR /&gt; put /etc/hosts&lt;BR /&gt; chmod 644 /etc/hosts&lt;BR /&gt; quit&lt;BR /&gt;EOF&lt;BR /&gt;done&lt;BR /&gt;&lt;/PASSWORD&gt;&lt;/USER&gt;</description>
    <pubDate>Mon, 09 Dec 2002 18:26:23 GMT</pubDate>
    <dc:creator>Paul Sperry</dc:creator>
    <dc:date>2002-12-09T18:26:23Z</dc:date>
    <item>
      <title>FTP Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860452#M95983</link>
      <description>I need to ftp and transfer files onto another box in a shell script.  How do I do the ftp portion of it?&lt;BR /&gt;&lt;BR /&gt;Thank you</description>
      <pubDate>Mon, 09 Dec 2002 18:11:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860452#M95983</guid>
      <dc:creator>ROSS HANSON</dc:creator>
      <dc:date>2002-12-09T18:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860453#M95984</link>
      <description>&lt;BR /&gt;#!/bin/ksh &lt;BR /&gt;ftp -n &lt;HOSTNAME or="" ip=""&gt; &amp;lt;&amp;lt; FTP &lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWD&gt; &lt;BR /&gt;bin &lt;BR /&gt;prompt &lt;BR /&gt;mput * &lt;BR /&gt;FTP &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-USA..&lt;BR /&gt;&lt;BR /&gt;&lt;/PASSWD&gt;&lt;/USERNAME&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Mon, 09 Dec 2002 18:20:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860453#M95984</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2002-12-09T18:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860454#M95985</link>
      <description>I use the following to push out the hosts file&lt;BR /&gt;any time I need to update it&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/ksh&lt;BR /&gt;for x in `more /home/root/list`&lt;BR /&gt;do&lt;BR /&gt; echo CONNECTING TO $x&lt;BR /&gt; ftp -n &amp;lt;&amp;lt;-EOF&lt;BR /&gt;        open $x&lt;BR /&gt; user &lt;USER&gt; &lt;PASSWORD&gt;&lt;BR /&gt; cd /etc&lt;BR /&gt; put /etc/hosts&lt;BR /&gt; chmod 644 /etc/hosts&lt;BR /&gt; quit&lt;BR /&gt;EOF&lt;BR /&gt;done&lt;BR /&gt;&lt;/PASSWORD&gt;&lt;/USER&gt;</description>
      <pubDate>Mon, 09 Dec 2002 18:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860454#M95985</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2002-12-09T18:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860455#M95986</link>
      <description>Here is an example of the ftp portion:&lt;BR /&gt;&lt;BR /&gt;ftp -i -v $TARGET_HOST &amp;lt;&amp;lt;-/* &amp;gt;$FTPLOG 2&amp;gt;&amp;amp;1&lt;BR /&gt;put $FILE $TARGET_DIRECTORY/$FILE (REPLACE&lt;BR /&gt;quit&lt;BR /&gt;/*  &lt;BR /&gt;&lt;BR /&gt;you will need to create a ".netrc" file on the target machine's user's home directory (the user running the ftp script).  See the man page on netrc.  example .netrc for user named goofy:&lt;BR /&gt;machine target_host login goofy password funny&lt;BR /&gt;The UNIX user name "goofy" has a password of "funny". The perms on .netrc MUST be 400.&lt;BR /&gt;&lt;BR /&gt;The ftp log file is in "$FTPLOG"&lt;BR /&gt;Just keep doing "put"s in the /*  /* construct&lt;BR /&gt;above and end the ftp session with the "quit" above.  You will want to do some preliminary checks like ping the target server to see if it is alive, and process the $FTPLOG for errors after the script is run.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Dec 2002 18:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860455#M95986</guid>
      <dc:creator>Byron Myers</dc:creator>
      <dc:date>2002-12-09T18:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860456#M95987</link>
      <description>I see a glaring flaw in all these responses. How do you know that the transfer was good? The better way to do this is using the Net::FTP module of Perl. You will need to download and install the Net::FTP module from &lt;A href="http://www.perl.com/CPAN" target="_blank"&gt;www.perl.com/CPAN&lt;/A&gt; but the good news is that this same Perl script will run on virtually any platform including Windows.&lt;BR /&gt;&lt;BR /&gt;Use if like this:&lt;BR /&gt;&lt;BR /&gt;ftp.pl file1 file2 file3&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "FTP ok"&lt;BR /&gt;else&lt;BR /&gt;  echo "FTP Bad; result ${STAT}"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;It will automatically log you in and transfer the files for you and actually attempt to repeat a failed xfer.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I never try to do FTP stuff in the shell anymore; the Perl solution just works too well.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Dec 2002 19:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-question/m-p/2860456#M95987</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-12-09T19:00:42Z</dc:date>
    </item>
  </channel>
</rss>

