--- Randall Paulk <[EMAIL PROTECTED]> wrote:
> Is there an easy way to transfer files automatically?
I would suggest getting libnet or Net::FTP to work (and I'm sorry, I
have no suggestions), but as a possible alternative, this from an old
script of mine, slightly edited:
open(FTP,"|/usr/bin/ftp -nv $host > FTP.log")
or die "$0:FTP pipe open:$!";
my $prv = select FTP; $|=1; select $prv; #THIS IS IMPORTANT!
print FTP "user $user $pswd\n";
print FTP "cdup\n";
print FTP "binary\n" if $b;
print FTP "get $src $trg\n";
print FTP "bye\n";
for this line:
select FTP; $|=1; select STDOUT; #THIS IS IMPORTANT!
my $prv = select FTP; # this makes FTP the default output stream
$|=1; # this unbuffers the default output stream
select $prv; # resets the default to whatever it was
If you don't do this unbuffering, the buffer may accumulate all your
commands until you close the filehandle!
The get could be a put, though I'd more likely just put the job on the
target machine and have it connect to each sibling and pull the data,
rather than manage so many disparate pushes. You could also code
something to email the log, or even put it in the crontab (I'm assuming
this is in the crontab anyway =o)
Paul
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/