<?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 shell script needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944502#M114367</link>
    <description>If you want to do error trapping, you could look at using either expect (NOT my most favourite utility), or Perl and the Net::FTP module (which I love using).&lt;BR /&gt;&lt;BR /&gt;I've written huge applications which use Net::FTP - alot more robust than Expect, and infinitely more flexible than just using shell.</description>
    <pubDate>Mon, 07 Apr 2003 09:38:46 GMT</pubDate>
    <dc:creator>Colin Topliss</dc:creator>
    <dc:date>2003-04-07T09:38:46Z</dc:date>
    <item>
      <title>FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944494#M114359</link>
      <description>Dear All,&lt;BR /&gt;&lt;BR /&gt;We were having two HP L3000 servers "vmtac1" &amp;amp; "vmtac2" which are the host names of the two servers.I want to FTP files from "vmtac1" to "vmtac2" from a perticular directory from one server to another server.I want to place the directory path &amp;amp; names in the ".txt" file and another shell script which will read the directories from the ".txt" file and FTP the files from "vmtac1" to "vmtac2" servers.I have written a shell script but it was not reliable because i was not much experienced in the unix shell scripting.Can any one can provide the script.BUt for each and every file i want to use "wait" clause and if any error occurs it to through the error to the "/utf001/dac/out" directory and that script has to through some message once its successfull.&lt;BR /&gt;&lt;BR /&gt;The text file looks like  "utf001.txt" which contains as below /utf001/dac/in. That means i want to copy the files from the "./in" directory to another server as mentioned above.The directory stucture as same as in the two servers.The main reason of reading the text file is i dont want to hardcode the dorectory path and name in the shell script.If want to change the directory name i can simple change it in the text file.&lt;BR /&gt;&lt;BR /&gt;Thanks for the advance in help.&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Sat, 05 Apr 2003 07:51:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944494#M114359</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2003-04-05T07:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944495#M114360</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Here are some threads with some sample ftp scripts that might help:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4e1b543254bfd611abdb0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4e1b543254bfd611abdb0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x74e49200caded5118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x74e49200caded5118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xadc85a3e6e0bd6118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xadc85a3e6e0bd6118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Apr 2003 10:17:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944495#M114360</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-04-05T10:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944496#M114361</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;This is the shell script like below but it dosent rearch for any file.is it possible to pass any $parameter in the "lcd" or "cd" at the ftp prompt.??&lt;BR /&gt;&lt;BR /&gt;ftp -n 00.000.000.00 &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user username password&lt;BR /&gt;lcd &lt;LOCAL directory="" path=""&gt;&lt;BR /&gt;cd &lt;REMORE directory="" path=""&gt;&lt;BR /&gt;mput *&lt;BR /&gt;quit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;How can i read directory path from the text file in the local as well as remote system?&lt;BR /&gt;&lt;BR /&gt;Please correct me if i am wrong.thanks.&lt;BR /&gt;&lt;BR /&gt;raj&lt;/REMORE&gt;&lt;/LOCAL&gt;</description>
      <pubDate>Sat, 05 Apr 2003 10:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944496#M114361</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2003-04-05T10:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944497#M114362</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think you'll need to write a script that reads your text file to get the local and remote directories, and then build the actual ftp script to be executed.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Apr 2003 10:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944497#M114362</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-04-05T10:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944498#M114363</link>
      <description>Raj,&lt;BR /&gt;&lt;BR /&gt;You may use wget - i am trying to build it on my 11.0 box - i have some issues but i definitely think it can be built.&lt;BR /&gt;&lt;BR /&gt;thereafter, you may run it as follows -&lt;BR /&gt;wget --proxy=off --input-file=&lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;in the filename placeholder above, you would specify utf001.txt.&lt;BR /&gt;&lt;BR /&gt;it auto-resumes ftp transfers, in case any error occurs. in fact, you can create bookmarks for particular directory's on the ftp host.&lt;BR /&gt;&lt;BR /&gt;instead of at ftp prompt, typing cd /abc/def/ghi, you may create a bookmark for hostname:/abc/def/ghi as say abcd and say at the ftp prompt open abcd - it has an option of storing or not storing the password and login details.&lt;BR /&gt;&lt;BR /&gt;hope this helps.&lt;BR /&gt;&lt;BR /&gt;- ramd.&lt;/FILENAME&gt;</description>
      <pubDate>Sat, 05 Apr 2003 12:04:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944498#M114363</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-05T12:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944499#M114364</link>
      <description>Raj,&lt;BR /&gt;&lt;BR /&gt;command requires the ftp hostname as a last arg...&lt;BR /&gt;&lt;BR /&gt;wget --proxy=off --input-file=&lt;INPUT_FILE&gt; host&lt;BR /&gt;&lt;BR /&gt;Ignore the line about bookmarks in my previous post - coz it is not right. bookmarks are available with ncftp - not wget. &lt;BR /&gt;&lt;BR /&gt;wget is used for recursive downloads of entire directory structures, while ncftp is an advanced interactive ftp client.&lt;BR /&gt;&lt;BR /&gt;- ramd.&lt;/INPUT_FILE&gt;</description>
      <pubDate>Sat, 05 Apr 2003 12:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944499#M114364</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-05T12:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944500#M114365</link>
      <description>Allow me to propose an alaternate solution, though I know this is annoying.&lt;BR /&gt;&lt;BR /&gt;Install this on both boxes:&lt;BR /&gt;&lt;BR /&gt;Secure shell&lt;BR /&gt;&lt;A href="http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA" target="_blank"&gt;http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Follow the attached box and you will be able to use the scp command to copy stuff back and forth with no trouble at all.  Plus you won't have to hard code passwords into your ftp scripts.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 06 Apr 2003 02:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944500#M114365</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-04-06T02:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944501#M114366</link>
      <description>Raj, have you considered using the remote copy command?&lt;BR /&gt;&lt;BR /&gt;rcp -r /path/directory vmtac2:/path/directory&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;rcp -r vntac1:/path/directory /path/directory&lt;BR /&gt;&lt;BR /&gt;the first commands assumes you are running the script on vmtac1 the second on vmtac2,  Or you can even specify both servers in your command line and run it from any machine.&lt;BR /&gt;&lt;BR /&gt;-Emerson</description>
      <pubDate>Mon, 07 Apr 2003 09:15:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944501#M114366</guid>
      <dc:creator>Emerson Valley</dc:creator>
      <dc:date>2003-04-07T09:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944502#M114367</link>
      <description>If you want to do error trapping, you could look at using either expect (NOT my most favourite utility), or Perl and the Net::FTP module (which I love using).&lt;BR /&gt;&lt;BR /&gt;I've written huge applications which use Net::FTP - alot more robust than Expect, and infinitely more flexible than just using shell.</description>
      <pubDate>Mon, 07 Apr 2003 09:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944502#M114367</guid>
      <dc:creator>Colin Topliss</dc:creator>
      <dc:date>2003-04-07T09:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944503#M114368</link>
      <description>Heres a very quick Perl example:&lt;BR /&gt;&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;use English;&lt;BR /&gt;use Env;&lt;BR /&gt;use Net::FTP;&lt;BR /&gt;&lt;BR /&gt;$host="disney";&lt;BR /&gt;$user_name="micky";&lt;BR /&gt;$user_password="mouse";&lt;BR /&gt;$dest_dir="/tmp";&lt;BR /&gt;$file_name="*.tar";&lt;BR /&gt;&lt;BR /&gt;# Create the connection&lt;BR /&gt;$ftp=Net::FTP-&amp;gt;new($host,debug =&amp;gt;1) or die ("Unable to make connection\n");&lt;BR /&gt;&lt;BR /&gt;# Login&lt;BR /&gt;$ftp-&amp;gt;login($user_name,$user_password) or die ("Unable to log in\n");&lt;BR /&gt;&lt;BR /&gt;# This is how to assign a return code&lt;BR /&gt;$return_code=($ftp-&amp;gt;cwd($dest_dir));&lt;BR /&gt;# This is where you could check your return code for failure&lt;BR /&gt;&lt;BR /&gt;# Read the commands contents into an array&lt;BR /&gt;@file_list=$ftp-&amp;gt;ls ($file_name);&lt;BR /&gt;&lt;BR /&gt;# Quit the session&lt;BR /&gt;$ftp-&amp;gt;quit;&lt;BR /&gt;&lt;BR /&gt;# Process the array - this example just prints it out&lt;BR /&gt;foreach (@file_list)&lt;BR /&gt;{&lt;BR /&gt;   print "$_\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can make this as complex as you'd like!&lt;BR /&gt;&lt;BR /&gt;Col</description>
      <pubDate>Mon, 07 Apr 2003 10:29:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944503#M114368</guid>
      <dc:creator>Colin Topliss</dc:creator>
      <dc:date>2003-04-07T10:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP shell script needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944504#M114369</link>
      <description>The easiest way  I think will be to using cpio.&lt;BR /&gt;How I have understand your problem. The users on both machine are the same and the directories and files are the same, right ?!&lt;BR /&gt;&lt;BR /&gt;Ok, use this from your local machine to the remote machine&lt;BR /&gt;&lt;BR /&gt;find . -print |cpio -pvumod |remsh &lt;REMOTE&gt; " cd /&lt;TARGETPATH&gt;; cpio -pumid"&lt;BR /&gt;&lt;BR /&gt;First of all you have to go to the directory from which you want have all sub-dirs to the remote machine and then use the commando I've mentioned above.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Roland&lt;BR /&gt;&lt;BR /&gt;&lt;/TARGETPATH&gt;&lt;/REMOTE&gt;</description>
      <pubDate>Mon, 07 Apr 2003 11:42:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-shell-script-needed/m-p/2944504#M114369</guid>
      <dc:creator>RolandH</dc:creator>
      <dc:date>2003-04-07T11:42:47Z</dc:date>
    </item>
  </channel>
</rss>

