<?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 FTP to multiple systems from a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817672#M829264</link>
    <description>Hello all&lt;BR /&gt;&lt;BR /&gt;I am trying to figure out how i would be able to accomplish an FTP to 2 or more systems from within the same script, each time I do it, it will only go to the 1st system and then when it hits the next system it tells me that the user is already logged in and fails.&lt;BR /&gt;&lt;BR /&gt;Any clues?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_SYSTEM=$(uname -n)&lt;BR /&gt;DEST06=mmdcux06.chsli.org&lt;BR /&gt;DEST10=mmdcux10.chsli.org&lt;BR /&gt;USER=fgrosb01&lt;BR /&gt;PW=poolgod1&lt;BR /&gt;REMOTECD=/tmp&lt;BR /&gt;LOCALCD=/home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;OUTPUT_FILE=/home/fgrosb01/syslogproject/messages_systems&lt;BR /&gt;MAIL=/usr/bin/mailx&lt;BR /&gt;ADDRESS=frank.grosberger@chsli.org&lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_SYSTEM=$(uname -n)&lt;BR /&gt;DEST06=mmdcux06.chsli.org&lt;BR /&gt;DEST10=mmdcux10.chsli.org&lt;BR /&gt;USER=fgrosb01&lt;BR /&gt;PW=&lt;BR /&gt;REMOTECD=/tmp&lt;BR /&gt;LOCALCD=/home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;OUTPUT_FILE=/home/fgrosb01/syslogproject/messages_systems&lt;BR /&gt;MAIL=/usr/bin/mailx&lt;BR /&gt;ADDRESS=frank.grosberger@chsli.org&lt;BR /&gt;&lt;BR /&gt;# This section will perform a series of FTP's to each system then taking&lt;BR /&gt;# the file located on each system and bringing it back to the local&lt;BR /&gt;# collection station system.&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST06} &amp;lt;&amp;lt; EOF&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux06&lt;BR /&gt;chmod 600 messages.mmdcux06&lt;BR /&gt;&lt;BR /&gt;sleep 30&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST10} &amp;lt;&amp;lt; EOF&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux10&lt;BR /&gt;chmod 600 messages.mmdcux10&lt;BR /&gt;&lt;BR /&gt;quit&lt;BR /&gt;sleep 30&lt;BR /&gt;&lt;BR /&gt;# This section takes each of the files that have been FTP'd from each&lt;BR /&gt;# system and will concatenate them into one file for single viewing&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cd /home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;for i in `ls`&lt;BR /&gt;do&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo Contents of $i &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cat $i &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo "End of report" &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;done&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Oct 2002 16:13:12 GMT</pubDate>
    <dc:creator>fg_1</dc:creator>
    <dc:date>2002-10-02T16:13:12Z</dc:date>
    <item>
      <title>FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817672#M829264</link>
      <description>Hello all&lt;BR /&gt;&lt;BR /&gt;I am trying to figure out how i would be able to accomplish an FTP to 2 or more systems from within the same script, each time I do it, it will only go to the 1st system and then when it hits the next system it tells me that the user is already logged in and fails.&lt;BR /&gt;&lt;BR /&gt;Any clues?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_SYSTEM=$(uname -n)&lt;BR /&gt;DEST06=mmdcux06.chsli.org&lt;BR /&gt;DEST10=mmdcux10.chsli.org&lt;BR /&gt;USER=fgrosb01&lt;BR /&gt;PW=poolgod1&lt;BR /&gt;REMOTECD=/tmp&lt;BR /&gt;LOCALCD=/home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;OUTPUT_FILE=/home/fgrosb01/syslogproject/messages_systems&lt;BR /&gt;MAIL=/usr/bin/mailx&lt;BR /&gt;ADDRESS=frank.grosberger@chsli.org&lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_SYSTEM=$(uname -n)&lt;BR /&gt;DEST06=mmdcux06.chsli.org&lt;BR /&gt;DEST10=mmdcux10.chsli.org&lt;BR /&gt;USER=fgrosb01&lt;BR /&gt;PW=&lt;BR /&gt;REMOTECD=/tmp&lt;BR /&gt;LOCALCD=/home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;OUTPUT_FILE=/home/fgrosb01/syslogproject/messages_systems&lt;BR /&gt;MAIL=/usr/bin/mailx&lt;BR /&gt;ADDRESS=frank.grosberger@chsli.org&lt;BR /&gt;&lt;BR /&gt;# This section will perform a series of FTP's to each system then taking&lt;BR /&gt;# the file located on each system and bringing it back to the local&lt;BR /&gt;# collection station system.&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST06} &amp;lt;&amp;lt; EOF&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux06&lt;BR /&gt;chmod 600 messages.mmdcux06&lt;BR /&gt;&lt;BR /&gt;sleep 30&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST10} &amp;lt;&amp;lt; EOF&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux10&lt;BR /&gt;chmod 600 messages.mmdcux10&lt;BR /&gt;&lt;BR /&gt;quit&lt;BR /&gt;sleep 30&lt;BR /&gt;&lt;BR /&gt;# This section takes each of the files that have been FTP'd from each&lt;BR /&gt;# system and will concatenate them into one file for single viewing&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cd /home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;for i in `ls`&lt;BR /&gt;do&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo Contents of $i &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cat $i &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo "End of report" &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Oct 2002 16:13:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817672#M829264</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-10-02T16:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817673#M829265</link>
      <description>You are missing an ftp 'quit' command in your first system.</description>
      <pubDate>Wed, 02 Oct 2002 16:26:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817673#M829265</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-10-02T16:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817674#M829266</link>
      <description>also the here document needs to be closed off with the EOF at the start of the line after the quit statement.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.</description>
      <pubDate>Wed, 02 Oct 2002 16:35:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817674#M829266</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2002-10-02T16:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817675#M829267</link>
      <description>script is missing something for ftp to switch over to the other server:&lt;BR /&gt;&lt;BR /&gt;after your first file transfer completes, go ahead and get rid of the sleep 30 and replace with:&lt;BR /&gt;&lt;BR /&gt;disconnect # this will drop the ftp link to server1&lt;BR /&gt;open ${DEST10} # this will open ftp to new server&lt;BR /&gt;&lt;BR /&gt;now delete your second ftp command.. you don't need this and this is what is complaining... it means you already have an ftp session active.&lt;BR /&gt;&lt;BR /&gt;now you should be in business assuming the rest of the script is clean... I built a small script with your syntax using these changes and it worked.&lt;BR /&gt;&lt;BR /&gt;Ted</description>
      <pubDate>Wed, 02 Oct 2002 16:38:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817675#M829267</guid>
      <dc:creator>Ted Ellis_2</dc:creator>
      <dc:date>2002-10-02T16:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817676#M829268</link>
      <description>Ok guys&lt;BR /&gt;&lt;BR /&gt;I made the changes that each of you specified.&lt;BR /&gt;Now what is happening is that the script will&lt;BR /&gt;run thru both FTP's successfully but the script&lt;BR /&gt;will terminate at the end of the 2nd FTP &lt;BR /&gt;without hitting the section that takes the &lt;BR /&gt;files and combines them. &lt;BR /&gt;&lt;BR /&gt;I tried putting combinations of CLOSE, quit, &lt;BR /&gt;or DISCONNECTS to end the FTP with no &lt;BR /&gt;success.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_SYSTEM=$(uname -n)&lt;BR /&gt;DEST06=mmdcux06.chsli.org&lt;BR /&gt;DEST10=mmdcux10.chsli.org&lt;BR /&gt;USER=fgrosb01&lt;BR /&gt;PW=poolgod1&lt;BR /&gt;REMOTECD=/tmp&lt;BR /&gt;LOCALCD=/home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;OUTPUT_FILE=/home/fgrosb01/syslogproject/messages_systems&lt;BR /&gt;MAIL=/usr/bin/mailx&lt;BR /&gt;ADDRESS=frank.grosberger@chsli.org&lt;BR /&gt;&lt;BR /&gt;# This section will perform a series of FTP's to each system then taking&lt;BR /&gt;# the file located on each system and bringing it back to the local &lt;BR /&gt;# collection station system.&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST06}&amp;lt;&amp;lt; EOF&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux06&lt;BR /&gt;chmod 600 messages.mmdcux06&lt;BR /&gt;disconnect&lt;BR /&gt;&lt;BR /&gt;open ${DEST10}&lt;BR /&gt;user ${USER} ${PW}&lt;BR /&gt;binary&lt;BR /&gt;lcd ${LOCALCD}&lt;BR /&gt;cd ${REMOTECD}&lt;BR /&gt;get messages.mmdcux10 &lt;BR /&gt;chmod 600 messages.mmdcux10&lt;BR /&gt;disconnect&lt;BR /&gt;close ${DEST10}&lt;BR /&gt;&lt;BR /&gt;# This section takes each of the files that have been FTP'd from each &lt;BR /&gt;# system and will concatenate them into one file for single viewing&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cd /home/fgrosb01/syslogproject/messagesfiles&lt;BR /&gt;for i in `ls`&lt;BR /&gt;do&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo Contents of $i &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;cat $i &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;echo "End of report" &amp;gt;&amp;gt; ${OUTPUT_FILE}&lt;BR /&gt;echo "****************************************************" &amp;gt;&amp;gt;${OUTPUT_FILE}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Oct 2002 18:25:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817676#M829268</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-10-02T18:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817677#M829269</link>
      <description>You'll have to put a EOF after the close ${DEST10}. Otherwise the commands in the script are still passed onto ftp which will not understand them. In short it should something like.&lt;BR /&gt;&lt;BR /&gt;ftp -n -v &amp;lt;&amp;lt; EOF&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;close ${DEST10}&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;# This section takes each of the files that have been FTP'd from each &lt;BR /&gt;# system and will concatenate them into one file for single viewing &lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Oct 2002 03:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817677#M829269</guid>
      <dc:creator>Evert Ladrak</dc:creator>
      <dc:date>2002-10-03T03:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: FTP to multiple systems from a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817678#M829270</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The EOF should be there before the cat command.&lt;BR /&gt;&lt;BR /&gt;Modify your script as below.&lt;BR /&gt;&lt;BR /&gt;ftp -n -v ${DEST06}&amp;lt;&amp;lt; EOF &lt;BR /&gt;...&lt;BR /&gt;close ${DEST10} &lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;cat /dev/null &amp;gt; ${OUTPUT_FILE} &lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;-balaji</description>
      <pubDate>Thu, 03 Oct 2002 10:20:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-to-multiple-systems-from-a-script/m-p/2817678#M829270</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2002-10-03T10:20:29Z</dc:date>
    </item>
  </channel>
</rss>

