<?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 (?) question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505771#M705248</link>
    <description>Theft and mod on Harry's concept below&lt;BR /&gt;&lt;BR /&gt;# Make a file list.&lt;BR /&gt;ls -1 /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;while read -r filename&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;/usr/bin/ftp -i -n WINDOZEbox.com &amp;lt;&amp;lt; EOF&lt;BR /&gt;user "anonymous" "SOMEemailaddr"&lt;BR /&gt;bin&lt;BR /&gt;put $filename&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;This way is pretty flexible, but it does fire up the ftp process for every file transfer. It does insure there will be no accidental user interaction.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;EOF</description>
    <pubDate>Wed, 16 Mar 2005 11:00:39 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2005-03-16T11:00:39Z</dc:date>
    <item>
      <title>ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505765#M705242</link>
      <description>Hi All!&lt;BR /&gt;&lt;BR /&gt; I need to send files from unix to windows 2000 ftp server.&lt;BR /&gt;I use the following comands:&lt;BR /&gt;ftp&lt;BR /&gt;open &lt;HOSTNAME&gt;&lt;BR /&gt;anonymous&lt;BR /&gt;email@domain.com&lt;BR /&gt;mput *.ema&lt;BR /&gt;y&lt;BR /&gt;&lt;BR /&gt;But I need to send a lot of files and I want to automate it. Help me!&lt;BR /&gt;Lima.&lt;/HOSTNAME&gt;</description>
      <pubDate>Wed, 16 Mar 2005 07:02:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505765#M705242</guid>
      <dc:creator>Vogra</dc:creator>
      <dc:date>2005-03-16T07:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505766#M705243</link>
      <description>&lt;BR /&gt;Won't happen unless your windoze box has an ftp daemon process running.&lt;BR /&gt;&lt;BR /&gt;You can frp FROM your windoze box to GET the file.&lt;BR /&gt;&lt;BR /&gt;If you DO have an ftp enabled windoze box, then on the unix system have a script like this:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;/usr/bin/ftp -i -n WINDOZEbox.com &amp;lt;&amp;lt; EOF&lt;BR /&gt;user "anonymous" "SOMEemailaddr"&lt;BR /&gt;bin&lt;BR /&gt;mput *.ema&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Wed, 16 Mar 2005 07:08:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505766#M705243</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-03-16T07:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505767#M705244</link>
      <description>Hi Lima,&lt;BR /&gt;There are two methods:&lt;BR /&gt;First is to install the latest version of WS-ftp on your windows-can. That way you can schedule ftp transfers. &lt;BR /&gt;Second is to create a tarball of all the files you need and ftp the tar-ball to your windows-can.&lt;BR /&gt;On windows you can untar i.e. by using winzip from the command-line in a batch script&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Wed, 16 Mar 2005 08:45:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505767#M705244</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-03-16T08:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505768#M705245</link>
      <description>Vogra,&lt;BR /&gt;you also want the "prompt" command prior to the mget, to avoid being asked to confirm each file.&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 16 Mar 2005 08:54:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505768#M705245</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-03-16T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505769#M705246</link>
      <description>Hi Vogra,&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;usr/bin/ftp -i -n -v  &amp;lt; /dir/ftp_connect.txt&lt;BR /&gt; &lt;BR /&gt;cat ftp_connect.txt&lt;BR /&gt;&lt;BR /&gt; open 10.32.113.177&lt;BR /&gt; user anonymous qq@qq.com&lt;BR /&gt; bin&lt;BR /&gt; hash&lt;BR /&gt; prompt off&lt;BR /&gt; cd dir&lt;BR /&gt; mput *.ema&lt;BR /&gt; bye&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rgds Jan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2005 10:41:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505769#M705246</guid>
      <dc:creator>Jan Sladky</dc:creator>
      <dc:date>2005-03-16T10:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505770#M705247</link>
      <description>Expect can help you to automate ftp applications.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/expect -f&lt;BR /&gt;#&lt;BR /&gt;spawn ftp &lt;HOSTNAME&gt;&lt;BR /&gt;expect "Name"&lt;BR /&gt;send "anonymous\r"&lt;BR /&gt;expect "Password:"&lt;BR /&gt;send "email@domain.com\r"&lt;BR /&gt;expect "ftp&amp;gt;"&lt;BR /&gt;send "binary\r"&lt;BR /&gt;expect "ftp&amp;gt;"&lt;BR /&gt;send "mput *.ema\r"&lt;BR /&gt;expect "mput"&lt;BR /&gt;send "y\r"&lt;BR /&gt;expect "ftp&amp;gt;"&lt;BR /&gt;send "exit\r"&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs&lt;/HOSTNAME&gt;</description>
      <pubDate>Wed, 16 Mar 2005 10:55:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505770#M705247</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2005-03-16T10:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505771#M705248</link>
      <description>Theft and mod on Harry's concept below&lt;BR /&gt;&lt;BR /&gt;# Make a file list.&lt;BR /&gt;ls -1 /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;while read -r filename&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;/usr/bin/ftp -i -n WINDOZEbox.com &amp;lt;&amp;lt; EOF&lt;BR /&gt;user "anonymous" "SOMEemailaddr"&lt;BR /&gt;bin&lt;BR /&gt;put $filename&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;This way is pretty flexible, but it does fire up the ftp process for every file transfer. It does insure there will be no accidental user interaction.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;EOF</description>
      <pubDate>Wed, 16 Mar 2005 11:00:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505771#M705248</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-03-16T11:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: ftp scripting (?) question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505772#M705250</link>
      <description>I would use the below script to create a /.netrc file on the fly and then each time I needed to send the file to the site all I have to do is make a call to ftp to that site.  (ie: ftp ftp_site)&lt;BR /&gt;&lt;BR /&gt;I have made some generic references to host/vendor names and such but the script builds the .netrc file on the fly with the appropriate entries to put multiople files to that server.&lt;BR /&gt;&lt;BR /&gt;Richard&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;create_netrc() {&lt;BR /&gt;  ROUTINE="::create_netrc:"&lt;BR /&gt;  cat &amp;gt; $HOME/.netrc&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;machine ${VENDOR_FTP}&lt;BR /&gt;login ${FTP_LOGIN}&lt;BR /&gt;password ${FTP_PASSWD}&lt;BR /&gt;macdef init&lt;BR /&gt;ha&lt;BR /&gt;as&lt;BR /&gt;prompt&lt;BR /&gt;verbose&lt;BR /&gt;lcd ${DIR}&lt;BR /&gt;mput ${FILENAME}&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;check_error&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;get_file() {&lt;BR /&gt;  ROUTINE="::get_file:"&lt;BR /&gt;  ftp -g ${VENDOR_FTP}  &amp;gt;$OFILE 2&amp;gt;&amp;amp;1&lt;BR /&gt;check_error&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;move_file() {&lt;BR /&gt;  cd ${DIR}&lt;BR /&gt;  mv * archive &amp;gt;$OFILE 2&amp;gt;&amp;amp;1&lt;BR /&gt;check_error&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;check_error() {&lt;BR /&gt;  STATUS=`echo $?`&lt;BR /&gt;  if [ ${STATUS} != 0 ]&lt;BR /&gt;  then&lt;BR /&gt;    mailx -s"`hostname`: ${VENDOR}  Download Failed" ${MAILBOX} &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;The following ERROR CONDITION occured during $ROUTINE: $STATUS&lt;BR /&gt;&lt;BR /&gt;The above error code resulted in the following error message:&lt;BR /&gt;&lt;BR /&gt;*** `cat $OFILE`&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;  exit $STATUS&lt;BR /&gt;  fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if [ -r /.netrc ]&lt;BR /&gt;then&lt;BR /&gt;        rm /.netrc&lt;BR /&gt;fi&lt;BR /&gt;FTP_LOGIN="anonymous"&lt;BR /&gt;FTP_PASSWD="root"&lt;BR /&gt;MAILBOX="root"&lt;BR /&gt;VENDOR="ftp"&lt;BR /&gt;VENDOR_FTP="ftp_ftp"&lt;BR /&gt;OFILE="/tmp/${VENDOR}_output"&lt;BR /&gt;DIR="/mnt/transfer/${VENDOR}"&lt;BR /&gt;DATE=`date +%m%d%Y`&lt;BR /&gt;FILENAME="PS_${DATE}"&lt;BR /&gt;create_netrc&lt;BR /&gt;chmod 0600 /.netrc&lt;BR /&gt;get_file&lt;BR /&gt;move_file&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 10:39:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripting-question/m-p/3505772#M705250</guid>
      <dc:creator>Richard Hood</dc:creator>
      <dc:date>2005-03-17T10:39:00Z</dc:date>
    </item>
  </channel>
</rss>

