in reply to ftp put problem!
#!/usr/bin/perl use Net::FTP; use File::Listing qw(parse_dir); $host = 'ServerName'; $path = '/home/'; $ftp = Net::FTP->new($host, Timeout => 1800) or die "Cannot contact $h +ost: $!"; $ftp->login('ID', 'PWD') or die "Cannot login ($host):" . $ftp->messag +e; $ftp->cwd($path) or die "Cannot change directory ($host):" . $ftp->mes +sage; #@Files = $ftp->ls('-lR'); @Files = 'ls -l'; #@Files = `ls -l $path' if $path is what you want a listing of #$ftp->binary(); #$ftp->ascii(); foreach $file (parse_dir(\@Files)) { my($name, $type, $size, $mtime, $mode) = @$file; $ftp->put("$name") or warn "Could not get $name, skipped: $!"; } $ftp->quit; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ftp put problem!
by bbi (Initiate) on Jul 29, 2008 at 20:42 UTC | |
by runrig (Abbot) on Jul 29, 2008 at 21:00 UTC | |
by bbi (Initiate) on Jul 29, 2008 at 21:06 UTC | |
by runrig (Abbot) on Jul 29, 2008 at 23:55 UTC |