<?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: Perl script for FTP file transfer... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982958#M294595</link>
    <description>can you put comments (givin description )on your code..then i can understand it properly...where to give the remote machine address for ftp trasnsfer or password for connection??? i can't understand in your code...</description>
    <pubDate>Wed, 18 Apr 2007 04:42:17 GMT</pubDate>
    <dc:creator>Dodo_5</dc:creator>
    <dc:date>2007-04-18T04:42:17Z</dc:date>
    <item>
      <title>Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982952#M294589</link>
      <description>i have some files in a folder "my folder" in  machine 1.i want to transfer the files from that folder to a different machine2 through ftp connection.and after finishing the transfer of files from machine1 to machine2,the files should  be kept in a different folder called "backup_machine1" in the same directory of machine1 where "my folder" is...for that ftp connection there are username and password also....&lt;BR /&gt;&lt;BR /&gt;  so i need a perl/unix script to perform this task.....can you help me doing that???</description>
      <pubDate>Tue, 17 Apr 2007 07:37:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982952#M294589</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-04-17T07:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982953#M294590</link>
      <description>Unix Script:&lt;BR /&gt;&lt;BR /&gt;ftp -vin &amp;lt;&lt;END_SCRIPT&gt;&lt;/END_SCRIPT&gt;open &lt;IPADDR&gt;&lt;BR /&gt;quote USER &lt;USRNAME&gt;&lt;BR /&gt;quote PASS &lt;PASSWORD&gt;&lt;BR /&gt;put &lt;SRCDIR&gt; &lt;DESTFILE&gt;&lt;BR /&gt;quit&lt;BR /&gt;END_SCRIPT&lt;BR /&gt;) | grep "226 Transfer complete." &amp;gt; /tmp/ftp$SRCFILE&lt;BR /&gt;&lt;BR /&gt;if [[ -s /tmp/ftp$SRCFILE ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "FTP Completed Sucessfully"&lt;BR /&gt;        mv &lt;SRCDIR&gt; &lt;BACKUP_FOLDER&gt;&lt;BR /&gt;        EXTSTA=0&lt;BR /&gt;else&lt;BR /&gt;         echo "FTP Failed"&lt;BR /&gt;        EXTSTA=1&lt;BR /&gt;fi&lt;/BACKUP_FOLDER&gt;&lt;/SRCDIR&gt;&lt;/DESTFILE&gt;&lt;/SRCDIR&gt;&lt;/PASSWORD&gt;&lt;/USRNAME&gt;&lt;/IPADDR&gt;</description>
      <pubDate>Tue, 17 Apr 2007 08:26:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982953#M294590</guid>
      <dc:creator>gstonian</dc:creator>
      <dc:date>2007-04-17T08:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982954#M294591</link>
      <description>can anyone put a perl script for this???&lt;BR /&gt;actually i need this in perl...</description>
      <pubDate>Tue, 17 Apr 2007 09:09:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982954#M294591</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-04-17T09:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982955#M294592</link>
      <description>The tricky part is the ftp transfer; the local move is easy. I assume this is a UNIX machine and there is no such thing as a folder on a UNIX box. There are directories so I assume that this is what you meant. Since you have whitespace (which is legal but dumb) embedded in your pathnames, take care to quote everything.&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset SRCDIR="/aaa/bbb/my folder"&lt;BR /&gt;typeset DESTDIR="/xxx/yyy/his folder"&lt;BR /&gt;typeset BACKUP_DIR="backup_machine1"&lt;BR /&gt;&lt;BR /&gt;typeset REMHOST="machB"&lt;BR /&gt;typeset USER="mickey"&lt;BR /&gt;typeset PASSWD="secret"&lt;BR /&gt;&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;&lt;BR /&gt;cd "${SRCDIR}"&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -ne 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Can't cd to ${SRCDIR}" &amp;gt;&amp;amp;2&lt;BR /&gt;    exit ${STAT}&lt;BR /&gt;  fi&lt;BR /&gt;ftpput.pl -h ${REMHOST} -l ${USER} -p ${PASSWD} -d "${DESTDIR}" -B *&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    mv * "${BACKUP_DIR}/"&lt;BR /&gt;    STAT=${?}&lt;BR /&gt;    echo "mv failed; status ${STAT}." &amp;gt;&amp;amp;2&lt;BR /&gt;  else&lt;BR /&gt;    echo "FTP failed; status ${STAT}." &amp;gt;&amp;amp;2&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;If you create a .netrc file you will not need to pass the password parameter. &lt;BR /&gt;&lt;BR /&gt;The perl script ftpput.pl is attached; invoke as "ftpput.pl -u" for full usage. The Perl script does full error checking.&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 09:10:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982955#M294592</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-17T09:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982956#M294593</link>
      <description>actually in the machine i am using windows and through putty trying to connect other unix box..&lt;BR /&gt;i want to transfer files from a folder ,ie,"c:/my folder/my files" in my machine to another one through ftp and after transferring i want to take a  backup of the file in "c:/backup/my backup".....like this only...</description>
      <pubDate>Tue, 17 Apr 2007 23:27:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982956#M294593</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-04-17T23:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982957#M294594</link>
      <description>&lt;BR /&gt;   use Net::FTP;&lt;BR /&gt;&lt;BR /&gt;    $ftp = Net::FTP-&amp;gt;new("some.host.name", Debug =&amp;gt; 0)&lt;BR /&gt;      or die "Cannot connect to some.host.name: $@";&lt;BR /&gt;&lt;BR /&gt;    $ftp-&amp;gt;login("anonymous",'-anonymous@')&lt;BR /&gt;      or die "Cannot login ", $ftp-&amp;gt;message;&lt;BR /&gt;&lt;BR /&gt;    $ftp-&amp;gt;cwd("/pub")&lt;BR /&gt;      or die "Cannot change working directory ", $ftp-&amp;gt;message;&lt;BR /&gt;&lt;BR /&gt;    $ftp-&amp;gt;put("that.file")&lt;BR /&gt;      or die "get failed ", $ftp-&amp;gt;message;&lt;BR /&gt;&lt;BR /&gt;    $ftp-&amp;gt;quit;&lt;BR /&gt;&lt;BR /&gt;You should then be able to move files about with&lt;BR /&gt;&lt;BR /&gt;$curlocation = "file1.txt";&lt;BR /&gt;$newlocation = "saved/filebackup.txt";&lt;BR /&gt;move($oldlocation, $newlocation);&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2007 03:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982957#M294594</guid>
      <dc:creator>gstonian</dc:creator>
      <dc:date>2007-04-18T03:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982958#M294595</link>
      <description>can you put comments (givin description )on your code..then i can understand it properly...where to give the remote machine address for ftp trasnsfer or password for connection??? i can't understand in your code...</description>
      <pubDate>Wed, 18 Apr 2007 04:42:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982958#M294595</guid>
      <dc:creator>Dodo_5</dc:creator>
      <dc:date>2007-04-18T04:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982959#M294596</link>
      <description>That code is truly self explanatory &lt;BR /&gt;(and straight from the help text :-)&lt;BR /&gt;&lt;BR /&gt;Read the example code carefully again.&lt;BR /&gt;If you can not figure out where a variable with the host name should go, then you should find help performing this particular job, or consider setting up a samba or nfs share to allow you to drag and drop the files.&lt;BR /&gt;&lt;BR /&gt;Check the help page for the perl ftp module: google: ftp perl&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2007 06:22:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982959#M294596</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-04-18T06:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script for FTP file transfer...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982960#M294597</link>
      <description>I am having a hard time understanding why you would ask a Windows question in a UNIX forum. You have been given more than enough Perl code to do this. The Perl script I attached will work equally well in Windows or UNIX and it should be a trivial matter to change the tiny bit of shell to a .bat file or you can install Microsoft Services for Unix (SFU); it's free and you then have a real shell on your Windows box. In any event, after running the Perl script I gave you the only remaining task is moving the local files and any child on the streets of Starkville could do that in a batch file.</description>
      <pubDate>Wed, 18 Apr 2007 09:20:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-for-ftp-file-transfer/m-p/3982960#M294597</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-18T09:20:01Z</dc:date>
    </item>
  </channel>
</rss>

