<?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 Scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802975#M82352</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply as I cannot login to the forum this morning as it show 'services unavailable'.&lt;BR /&gt;&lt;BR /&gt;BTW, what error did you get ?&lt;BR /&gt;&lt;BR /&gt;Did you submit the job by cron ? If so, you have to specific the full path of comm, i.e. /usr/bin/comm&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
    <pubDate>Thu, 12 Sep 2002 03:10:33 GMT</pubDate>
    <dc:creator>Patrick Chim</dc:creator>
    <dc:date>2002-09-12T03:10:33Z</dc:date>
    <item>
      <title>FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802969#M82346</link>
      <description>I wrote the following Script to ftp files from ServerA to ServerB. How do I modify the script to only transfer new files which I haven't copied.&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;{ echo "open ServerB &lt;BR /&gt;user user pass &lt;BR /&gt;hash &lt;BR /&gt;cd /directory/&lt;BR /&gt;mget *&lt;BR /&gt;close" &lt;BR /&gt;} | ftp -i -n -v 2&amp;gt;&amp;amp;1 | tee /tmp/ftplog&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2002 05:50:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802969#M82346</guid>
      <dc:creator>Ishmael</dc:creator>
      <dc:date>2002-09-10T05:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802970#M82347</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Here is a script for you.&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;if [ ! -f filename.txt ]&lt;BR /&gt;then&lt;BR /&gt;   cp /dev/null filename.txt&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;mv filename.txt filename.prev&lt;BR /&gt;&lt;BR /&gt;ftp -n &lt;SERVER b=""&gt; &amp;lt;&lt;EOF&gt; filename.curr&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWORD&gt;&lt;BR /&gt;cd &lt;DIRECTORY&gt;&lt;BR /&gt;nlist&lt;BR /&gt;quit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;comm -23 filename.curr filename.prev &amp;gt; filename.diff&lt;BR /&gt;&lt;BR /&gt;for i in `cat filename.diff`&lt;BR /&gt;do&lt;BR /&gt;ftp -n &lt;SERVER b=""&gt; &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user &lt;USERNAME&gt; &lt;PASSWORD&gt;&lt;BR /&gt;cd &lt;DIRECTORY&gt;&lt;BR /&gt;get $i&lt;BR /&gt;quit&lt;BR /&gt;EOF&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This is just a simple script but it works (I have try it). You can further enhance it to fulfill your requirement !&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick&lt;/DIRECTORY&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/SERVER&gt;&lt;/DIRECTORY&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/EOF&gt;&lt;/SERVER&gt;</description>
      <pubDate>Tue, 10 Sep 2002 06:17:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802970#M82347</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-10T06:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802971#M82348</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Before you start the ftp you will have to extend your script to do an ls -l on the dir, sending the output to a file.&lt;BR /&gt;&lt;BR /&gt;E.G.&lt;BR /&gt;&lt;BR /&gt;ls -l | awk @{print $9}' &amp;gt; /tmp/ftplist&lt;BR /&gt;&lt;BR /&gt;Each time you do an ftp compare it with this file and if there are  new files then ftp them, The script should then update it if there are new files, so that at next run time these files do not get sent again.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2002 06:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802971#M82348</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-09-10T06:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802972#M82349</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry about that ! I've forgotten to rename the file after the testing.&lt;BR /&gt;&lt;BR /&gt;By the way, your have to replace the 'filename.txt' with 'filename.curr'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Tue, 10 Sep 2002 06:29:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802972#M82349</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-10T06:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802973#M82350</link>
      <description>Hello,&lt;BR /&gt;everything looks nice especially the latest reply. But there is little weakness. Use -lL. The "L" looks for links. And I have a question:&lt;BR /&gt;why don't u use PERL?? If u do the last reply, you will run into trouble with awk. Awk (and sed) is restricted to 3000 values to be processed and about this number it will go unpredictible. I experienced this very fact and have been using PERL exclusively since.&lt;BR /&gt;The algorithm could look alike.&lt;BR /&gt;(:&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Sep 2002 04:17:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802973#M82350</guid>
      <dc:creator>Christian Fandel</dc:creator>
      <dc:date>2002-09-11T04:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802974#M82351</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;Patrick, the comm command after the first ftp doesn't seem to be executed. Any idea why?</description>
      <pubDate>Wed, 11 Sep 2002 05:55:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802974#M82351</guid>
      <dc:creator>Ishmael</dc:creator>
      <dc:date>2002-09-11T05:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802975#M82352</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply as I cannot login to the forum this morning as it show 'services unavailable'.&lt;BR /&gt;&lt;BR /&gt;BTW, what error did you get ?&lt;BR /&gt;&lt;BR /&gt;Did you submit the job by cron ? If so, you have to specific the full path of comm, i.e. /usr/bin/comm&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Thu, 12 Sep 2002 03:10:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802975#M82352</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-12T03:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802976#M82353</link>
      <description>Hi Patrick,&lt;BR /&gt;&lt;BR /&gt;Thanks for the response.&lt;BR /&gt;I ran the complete script from the command line and it gave the folliwng error :-&lt;BR /&gt;cat: Cannot open tempfile.diff: No such file or directory&lt;BR /&gt;&lt;BR /&gt;tempfile.diff doesn't seem to be created by comm. But if I run the full comm command manully from cmd line it works fine.&lt;BR /&gt;I forced it run as /usr/bin/ksh and /usr/bin/sh but nothing works. &lt;BR /&gt;</description>
      <pubDate>Thu, 12 Sep 2002 06:17:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802976#M82353</guid>
      <dc:creator>Ishmael</dc:creator>
      <dc:date>2002-09-12T06:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802977#M82354</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Can you attach the script so that I can have a look ??&lt;BR /&gt;&lt;BR /&gt;Does the file tempfile.diff create by you or other ? Do you have write permission on it ? How about if you specific all file with absolute path ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Thu, 12 Sep 2002 07:48:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802977#M82354</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-12T07:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802978#M82355</link>
      <description>Script as requested.&lt;BR /&gt;#!/usr/bin/ksh &lt;BR /&gt;#set -x&lt;BR /&gt;cd /testdata/temp_data/test&lt;BR /&gt;if [ ! -f tempfile.curr ] &lt;BR /&gt;then &lt;BR /&gt;cp /dev/null tempfile.curr &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;mv tempfile.curr tempfile.prev &lt;BR /&gt;&lt;BR /&gt;ftp -n -v -i machineB  &amp;lt;&amp;lt; EOF &amp;gt; tempfile.curr &lt;BR /&gt;user login password &lt;BR /&gt;cd /IN/TEMP/ &lt;BR /&gt;nlist c*&lt;BR /&gt;close&lt;BR /&gt;quit&lt;BR /&gt;EOF &lt;BR /&gt;&lt;BR /&gt;/usr/bin/ksh comm -23 tempfile.curr tempfile.prev &amp;gt; tempfile.diff&lt;BR /&gt;&lt;BR /&gt;for i in `cat tempfile.diff`&lt;BR /&gt;do &lt;BR /&gt;ftp -n machineB &amp;lt;&amp;lt; EOF &lt;BR /&gt;user login password &lt;BR /&gt;cd /IN/TEMP/ &lt;BR /&gt;get $i &lt;BR /&gt;quit&lt;BR /&gt;EOF &lt;BR /&gt;done &lt;BR /&gt;</description>
      <pubDate>Thu, 12 Sep 2002 13:41:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802978#M82355</guid>
      <dc:creator>Ishmael</dc:creator>
      <dc:date>2002-09-12T13:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802979#M82356</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It seems that there is a space at the end of each line of the set of ftp statement. I think you just copy the content from the browser and paste it in your terminal, right ? Because I use this step that it will paste one more space at each end of line.&lt;BR /&gt;&lt;BR /&gt;If you delete all these spaces then it will ok and I've try it !&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Fri, 13 Sep 2002 00:06:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802979#M82356</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-13T00:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802980#M82357</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Furthermore, you need not to make a ksh to run the command 'comm'. Just change it to '/usr/bin/comm -23 ...' and that's OK.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Fri, 13 Sep 2002 01:51:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-scripts/m-p/2802980#M82357</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-13T01:51:56Z</dc:date>
    </item>
  </channel>
</rss>

