Category: | FTP |
Author/Contact Info | ergowolf |
Description: | This script gets multiple files from multiple file servers. It requires some minor tweaks to change the script. For example, you could change get to put or the user name from Randal to vroom. It will take aas many servers and files as you would like. |
use Net::FTP; my $ftp; my $filename; my @files = ('file1','file2'); my %servers = ( 'box1' => 'password', 'box2' => 'password', ); chdir "path/where/you/want/the/files"; foreach (keys %servers) { # line 16 $ftp = Net::FTP -> new($_); print $ftp -> message(), "\n"; $ftp -> login('Randal', $servers{$_}); print $ftp -> message(), "\n"; $ftp -> binary(); print $ftp -> message(), "\n"; $ftp -> cwd('/your/path'); print $ftp -> message(), "\n"; foreach $filename (@files) { $ftp -> get( "$filename", "$_$filename"); print $ftp -> message(), "\n"; } print "Completed $_\n\n"; $ftp -> quit(); } exit; |
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: multiftp.pl
by Anonymous Monk on Jun 09, 2000 at 00:36 UTC | |
Re: multiftp.pl
by cybear (Monk) on May 24, 2002 at 18:54 UTC | |
by Anonymous Monk on May 07, 2003 at 17:14 UTC | |
by Anonymous Monk on Aug 28, 2003 at 21:12 UTC | |
by Anonymous Monk on Jul 23, 2004 at 05:45 UTC | |
by skiboy (Sexton) on Oct 17, 2004 at 13:36 UTC |