Still new to perl... trying to create an FTP connection to move backups from one machine to another.
Code... #!/usr/bin/perl # Backup tyr web directory # to ODIN via FTP
# Begin remote transfer of file(s) # use Net::FTP; $ftp = Net::FTP->new("hostname", Debug => 1) or die "Could establish conneciton to hostname: $@";
$ftp->login("username", 'password') or die "Could not login ", $ftp->message;
$ftp->put(`../path/to/*-www.tar.gz`) or die "Could not transfer files ", $ftp->message;
$ftp->quit;
Error...
Net::FTP>>> Net::FTP(2.71)
Net::FTP>>> Exporter(5.566)
Net::FTP>>> Net::Cmd(2.24)
Net::FTP>>> IO::Socket::INET(1.26)
Net::FTP>>> IO::Socket(1.27)
Net::FTP>>> IO::Handle(1.21)
Net::FTP=GLOB(0x8133e3c)<<< 220-SCL Deployment FTP Server
Net::FTP=GLOB(0x8133e3c)<<< WarFTPd 1.81.00 (Mar 3 2002) Ready
Net::FTP=GLOB(0x8133e3c)<<< (C)opyright 1996 - 2002 by Jarle (jgaa) Aase - all rights reserved.
Net::FTP=GLOB(0x8133e3c)<<< 220 Please enter your user name.
Net::FTP=GLOB(0x8133e3c)>>> user tyrback
Net::FTP=GLOB(0x8133e3c)<<< 331 User name okay, Need password.
Net::FTP=GLOB(0x8133e3c)>>> PASS ....
Net::FTP=GLOB(0x8133e3c)<<< 230 User logged in.
sh: line 1: ../path/to/02192004-www.tar.gz: Permission denied
fileparse(): need a valid pathname at /usr/lib/perl5/5.8.0/Net/FTP.pm line 705
1) Clean up your quoting.
2) I don't think Net::FTP supports an "mput", so you'll have to glob your files in a foreach loop, calling the method on each file.
3) Try it for one file first to see if all the rest of the module works as you want, then extend.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>