<?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 script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557710#M917892</link>
    <description>Hello John,&lt;BR /&gt;&lt;BR /&gt;the archoes must be full of answers for your question,&lt;BR /&gt;as I remember having answered quite some of them ;-)&lt;BR /&gt;&lt;BR /&gt;Anyway, create or edit the file $HOME/.netrc and set&lt;BR /&gt;permissions to 600 or 400 - it will NOT work otherwise.&lt;BR /&gt;The content should be something like:&lt;BR /&gt;&lt;BR /&gt;machine MARS user JOHN password SECRET macdef init&lt;BR /&gt;cd /DIR-ON-TARGET&lt;BR /&gt;lcd /DIR-ON_LOCAL-STATION&lt;BR /&gt;bin&lt;BR /&gt;prompt&lt;BR /&gt;mget FILE-PATTERN&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There must be an empty line after that paragraph.&lt;BR /&gt;All the UPPERCASE words must be replaced with your&lt;BR /&gt;own values, perhaps in lower-case... ;-)&lt;BR /&gt;&lt;BR /&gt;Which means, you DO have a plain-text password in&lt;BR /&gt;that file on your local station! Hence the permissions!&lt;BR /&gt;&lt;BR /&gt;Next time you (the userid with that $HOME directory)&lt;BR /&gt;start "ftp" to that target-station, it will NOT ask for&lt;BR /&gt;username nor password, but use those from the ".netrc".&lt;BR /&gt;Then it will change the directories, remote and locally,&lt;BR /&gt;set transfermode to binary, turn off the prompt for Y/N&lt;BR /&gt;for each file, and transfer all the files matching that&lt;BR /&gt;pattern from remote to local station, and quit.&lt;BR /&gt;&lt;BR /&gt;If you want ASCII-conversion, use "ascii" instead of&lt;BR /&gt;"bin", if you want transfer from local to remote use&lt;BR /&gt;"mput" instead of "mget" (read: multiple get/put).&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;   Wodisch</description>
    <pubDate>Fri, 27 Jul 2001 20:05:11 GMT</pubDate>
    <dc:creator>Wodisch</dc:creator>
    <dc:date>2001-07-27T20:05:11Z</dc:date>
    <item>
      <title>FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557706#M917888</link>
      <description>I want to make an FTP script that can be run automatically to upload files.  How do I pass the login name, password and commands from within the script?</description>
      <pubDate>Thu, 26 Jul 2001 22:27:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557706#M917888</guid>
      <dc:creator>John Curtis</dc:creator>
      <dc:date>2001-07-26T22:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557707#M917889</link>
      <description>One way to do this would be by using netrc&lt;BR /&gt;Have a look at the man page on how to do it&lt;BR /&gt;man netrc&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Michael</description>
      <pubDate>Thu, 26 Jul 2001 22:59:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557707#M917889</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2001-07-26T22:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557708#M917890</link>
      <description>Another way is to do something like this:&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;ftp -i -n -v &amp;gt;&amp;gt; /tmp/logfile 2&amp;gt;&amp;amp;1 &amp;lt;&amp;lt; ENDFTP&lt;BR /&gt;open machine.domain.com&lt;BR /&gt;user username password&lt;BR /&gt;bin&lt;BR /&gt;cd /remote/dir&lt;BR /&gt;put filename&lt;BR /&gt;put filename1&lt;BR /&gt;bye&lt;BR /&gt;ENDFTP&lt;BR /&gt;&lt;BR /&gt;The stuff between the '&amp;lt;&lt;ENDFTP&gt;&lt;/ENDFTP&gt;</description>
      <pubDate>Thu, 26 Jul 2001 23:09:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557708#M917890</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-07-26T23:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557709#M917891</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;Using the 'netrc' method has better security implicatations since you don't have to bury a password in a script.  However, here's another way:&lt;BR /&gt;&lt;BR /&gt;{ &lt;BR /&gt;echo "open $HOST &lt;BR /&gt;user $WHO $WHOPASS &lt;BR /&gt;hash &lt;BR /&gt;$ACTION $LOCALFILE $REMOTEFILE &lt;BR /&gt;close" &lt;BR /&gt;} | ftp -i -n -v 2&amp;gt;&amp;amp;1 | tee -a $LOGFILE &lt;BR /&gt;&lt;BR /&gt;...the $Variables should be self-explanatory.  This snipet captures the ftp dialog into $LOGFILE.  The "hash" shows the transfer progress.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 26 Jul 2001 23:13:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557709#M917891</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-26T23:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557710#M917892</link>
      <description>Hello John,&lt;BR /&gt;&lt;BR /&gt;the archoes must be full of answers for your question,&lt;BR /&gt;as I remember having answered quite some of them ;-)&lt;BR /&gt;&lt;BR /&gt;Anyway, create or edit the file $HOME/.netrc and set&lt;BR /&gt;permissions to 600 or 400 - it will NOT work otherwise.&lt;BR /&gt;The content should be something like:&lt;BR /&gt;&lt;BR /&gt;machine MARS user JOHN password SECRET macdef init&lt;BR /&gt;cd /DIR-ON-TARGET&lt;BR /&gt;lcd /DIR-ON_LOCAL-STATION&lt;BR /&gt;bin&lt;BR /&gt;prompt&lt;BR /&gt;mget FILE-PATTERN&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There must be an empty line after that paragraph.&lt;BR /&gt;All the UPPERCASE words must be replaced with your&lt;BR /&gt;own values, perhaps in lower-case... ;-)&lt;BR /&gt;&lt;BR /&gt;Which means, you DO have a plain-text password in&lt;BR /&gt;that file on your local station! Hence the permissions!&lt;BR /&gt;&lt;BR /&gt;Next time you (the userid with that $HOME directory)&lt;BR /&gt;start "ftp" to that target-station, it will NOT ask for&lt;BR /&gt;username nor password, but use those from the ".netrc".&lt;BR /&gt;Then it will change the directories, remote and locally,&lt;BR /&gt;set transfermode to binary, turn off the prompt for Y/N&lt;BR /&gt;for each file, and transfer all the files matching that&lt;BR /&gt;pattern from remote to local station, and quit.&lt;BR /&gt;&lt;BR /&gt;If you want ASCII-conversion, use "ascii" instead of&lt;BR /&gt;"bin", if you want transfer from local to remote use&lt;BR /&gt;"mput" instead of "mget" (read: multiple get/put).&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;   Wodisch</description>
      <pubDate>Fri, 27 Jul 2001 20:05:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/2557710#M917892</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-07-27T20:05:11Z</dc:date>
    </item>
  </channel>
</rss>

