<?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/3480511#M704433</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please find attached the input file to my FTP script. The FTP script should read the IP of the machines which it is suppose to connect from the input file. The input file will be located in a directory called /home/config/.&lt;BR /&gt;&lt;BR /&gt;The FTP script should get the file named app_mmddyyyy_* in case the machine has a version 5.0 in the input file.&lt;BR /&gt;&lt;BR /&gt;The FTP script should get the file named app_mmddyy_* in case the machine has a version 5.5 in the input file.&lt;BR /&gt;&lt;BR /&gt;Also, the FTP script should send error messages to a log file in case it is unable to connect to any of the machines mentioned in the input file or if the file which it is trying to obtain is not available.&lt;BR /&gt;&lt;BR /&gt;Hope it is little clear now.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pat&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Feb 2005 16:56:37 GMT</pubDate>
    <dc:creator>Pat Peter</dc:creator>
    <dc:date>2005-02-08T16:56:37Z</dc:date>
    <item>
      <title>FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480507#M704429</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to write a FTP script to connect to various machines. The machine names should be obtained from a separate file. The file would look like&lt;BR /&gt;&lt;BR /&gt;MachineIP      AppVersion&lt;BR /&gt;.........     .........&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now the ftp script should connect to all these machines and get file app_mmddyyyy_* in case the application is in 5.5 version. If the application is in 5.0 version the FTP script should obtain the file app_mmddyy_*.&lt;BR /&gt;&lt;BR /&gt;Also, the FTP script should send error messages to a log file in case it is unable to connect to any of the machine or if the file which it is trying to obtain is not available.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pat&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Feb 2005 18:46:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480507#M704429</guid>
      <dc:creator>Pat Peter</dc:creator>
      <dc:date>2005-02-07T18:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480508#M704430</link>
      <description>This is fairly easy except for some missing information: &lt;BR /&gt; &lt;BR /&gt;1. Where are these files (you must specify the full path to the files)&lt;BR /&gt; &lt;BR /&gt;2. Where are these files going to be stored (as before, you need a full pathname for the destination)&lt;BR /&gt; &lt;BR /&gt;3. How do you determine the version of the application? &lt;BR /&gt; &lt;BR /&gt;Remember, FTP is not a shell and it does not login or have access to special commands. Run the ftp command by hand to see what steps you need (login, password, cd to remote directory, lcd to local directory, etc). To see what commands you have available in FTP, type the ? or help command.</description>
      <pubDate>Mon, 07 Feb 2005 21:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480508#M704430</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-02-07T21:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480509#M704431</link>
      <description>Additional help.&lt;BR /&gt;&lt;BR /&gt;How to actually automate:&lt;BR /&gt;&lt;BR /&gt;USER=username&lt;BR /&gt;PASS=password&lt;BR /&gt;COLLECT=" /home/username/audit"&lt;BR /&gt;FILE1=" au_audit.op"&lt;BR /&gt;&lt;BR /&gt;cd /home/ye103910/logftp01&lt;BR /&gt;&lt;BR /&gt;ftp -nv 10.215.15.1 &amp;lt;&lt;FTPEOF&gt;/tmp/get_logftp01.$$&lt;BR /&gt;user ${USER} ${PASS}&lt;BR /&gt;cd ${COLLECT}&lt;BR /&gt;get ${FILE1}&lt;BR /&gt;quit&lt;BR /&gt;FTPEOF&lt;BR /&gt;&lt;BR /&gt;You can actually use this as a function and feed in the information from your  data file.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/FTPEOF&gt;</description>
      <pubDate>Mon, 07 Feb 2005 22:36:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480509#M704431</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-02-07T22:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480510#M704432</link>
      <description>&lt;BR /&gt;See Clay's answer (the attachment) for using perl to ftp:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=550649" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=550649&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 08 Feb 2005 07:26:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480510#M704432</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-02-08T07:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480511#M704433</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please find attached the input file to my FTP script. The FTP script should read the IP of the machines which it is suppose to connect from the input file. The input file will be located in a directory called /home/config/.&lt;BR /&gt;&lt;BR /&gt;The FTP script should get the file named app_mmddyyyy_* in case the machine has a version 5.0 in the input file.&lt;BR /&gt;&lt;BR /&gt;The FTP script should get the file named app_mmddyy_* in case the machine has a version 5.5 in the input file.&lt;BR /&gt;&lt;BR /&gt;Also, the FTP script should send error messages to a log file in case it is unable to connect to any of the machines mentioned in the input file or if the file which it is trying to obtain is not available.&lt;BR /&gt;&lt;BR /&gt;Hope it is little clear now.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pat&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2005 16:56:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480511#M704433</guid>
      <dc:creator>Pat Peter</dc:creator>
      <dc:date>2005-02-08T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480512#M704434</link>
      <description>First of all, ditch the header line and the blank lines from your input file (or at least adopt the universal convention of preceding them with '#' to signal a comment. You STILL haven't bothered to identify the directory in which these files are stored. I will be amazed if anyone bothers to write this for you when you haven't even made the slightest attempt at it.&lt;BR /&gt;&lt;BR /&gt;Reading your input sans the header/blank line is easy:&lt;BR /&gt;&lt;BR /&gt;INFILE=/xxx/myfile&lt;BR /&gt;&lt;BR /&gt;cat ${INFILE} | while read IP VERS &lt;BR /&gt;  do&lt;BR /&gt;     echo "IP: ${IP} Version: ${VERS}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Now I will give you the tricky piece, ftpget.pl:&lt;BR /&gt;&lt;BR /&gt;ftpget.pl -h ${IP} -l cstephen -p "topsecret" -d ${REMOTE_DIR} -L 'app_mmddyy_*' | while read FNAME&lt;BR /&gt;  do&lt;BR /&gt;     ftpget.pl -h ${IP} -l cstephen -p "topsecret" ${FNAME}&lt;BR /&gt;     STAT=${?}&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;These are the bare bones of the idea. I'll leave the rest as an exercise. I strongly suggest that you use .netrc files to store the passwd's so that no -p argument is necessary. It's also probably much smarter to use hostnames rather than IP addresses but ftpget.pl will handle either.&lt;BR /&gt;&lt;BR /&gt;Invoke as ftpget.pl -u for full usage. You can also use the -z option to check for remote host connectivity.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2005 17:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480512#M704434</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-08T17:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480513#M704435</link>
      <description>Clay - Thanks for your script. I am sorry that I forgot to mention the directory in which I need to store the files. &lt;BR /&gt;&lt;BR /&gt;The files are actually to be stored in the directory /home/logs/.&lt;BR /&gt;&lt;BR /&gt;Can you please suggest me If I could use Anonymous FTP instead of the normal FTP. Anonymous FTP is enabled in all the machines to which I am going to connect.&lt;BR /&gt;&lt;BR /&gt;Also, the requirement is changed little in the sense that the input file will have only the machine names of the machine to which I need to connect. There will not be any version column.&lt;BR /&gt;&lt;BR /&gt;I have to get the file app_mmddyyyy_* from /home/bin/logs directory of the remote machines to which I am connecting. &lt;BR /&gt;&lt;BR /&gt;The script should also write errors to a file /home/config/errors in case if it is not able to connect to any of the machine listed in the input file or if the file is missing in the remote machine.&lt;BR /&gt;&lt;BR /&gt;I am very new to FTP. Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pat&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2005 18:46:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480513#M704435</guid>
      <dc:creator>Pat Peter</dc:creator>
      <dc:date>2005-02-08T18:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480514#M704436</link>
      <description>The ftpget.pl script will work just fine with anonymous ftp; you simply simply -l anonymous as the user and you shouldn't need a -p passwd argument. You specify the directory with the -d arg. From this point on, you really don't need to know any Perl at all. It's all a matter of shell scripting that invokes ftpget.pl. I have no intention of teaching you shell scripting  -- that should be part of your job. Invoke as "ftpget.pl -u" for a full usage display.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2005 21:05:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script/m-p/3480514#M704436</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-08T21:05:53Z</dc:date>
    </item>
  </channel>
</rss>

