After i execute it, i receive this error message and I really need somebody opinion about this error...Thanks... Couldn't get handle: Failure at /usr/lib/perl5/site_perl/5.8.0/Net/SFTP.pm line 168. Couldn't write to remote file: Failure at /usr/lib/perl5/site_perl/5.8.0/Net/SFTP.pm line 263. Couldn't close file: No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Net/SFTP.pm line 203. ...problem !... at rput.pl line 40.use Net::SSH::Perl; use Net::SFTP; $host = '***.***.***.***'; $username = '****'; $passwd = '****'; $remote_path = '/home/roime/'; $local_path = '/flow/flow'; chdir $local_path or die "Could Not Change Dir To $local_path!"; opendir(FILE, $local_path) || die("Cannot open directory"); @files=readdir(FILE); closedir(FILE); foreach $file(@files) { next if(-d $file); next if($file eq ".flow"); { $sftp=Net::SFTP->new($host, user => $username, password => $passwd, debug => 0) or die "Cannot connect to $host:$@"; $sftp->put("$file", "$remote_path") or die "...problem !..."; $sftp->ls($remote_path); unlink("$local_path$file") or die "having trouble deleting $file:$!";; print "$file deleted success....\n"; } } sub usage { my($name) = $0; $name =~ s/.*\///; print STDERR "Usage: $name <host> <username> <passwd> <remote_path> <l +ocal_path>\n"; exit; }
In reply to Net::SFTP In Linux ....... Error by kicap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |