Transferencia de archivos a través de Net::SFTP::Foreing
Publicado: 2015-07-20 16:48 @742
¿Qué tal, estimados? Necesito su ayuda, tengo el siguiente script si bien no me arroja error tampoco me realiza el copiado del archivo... Favor, su ayuda. El script es el siguiente :
Using perl Syntax Highlighting
- #!/usr/bin/perl
- use Net::SFTP::Foreign;
- my $sftp = Net::SFTP::Foreign->new(
- '$host',
- user => '$user',
- password => '$password',
- port => 22,
- more => [ -o => 'PreferredAuthentications=password,keyboard-interactive,publickey' ]
- );
- if ( not $sftp ) {
- die("Error: No Connection:$@");
- }
- elsif ( $sftp->error ) {
- die( "Connect Failed : " . $sftp->status );
- }
- else {
- if (!$sftp->put(
- "archivos/prueba.txt", "inbox/prueba.txt",
- resume => 1,
- copy_perm => 0,
- copy_time => 0
- )
- ) {
- print "Failed to Transfer: " . $sftp->error;
- }
- else {
- print "Transferencia OK!!";
- }
- }
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4