Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Net::OpenSSH rsync_get/rsync_put

by salva (Abbot)
on Nov 27, 2013 at 08:31 UTC ( #1064577=note: print w/replies, xml ) Need Help??

in reply to Net::OpenSSH rsync_get/rsync_put

It works for me.

What does "it don't work" means exactly?

Replies are listed 'Best First'.
Re^2: Net::OpenSSH rsync_get/rsync_put
by shivangi (Initiate) on Nov 28, 2013 at 08:39 UTC

    Hello Salva, The file gets successfully transferred by rsync_put but i am not able to see its progress. I had set the progress atrribute to 1, still the transfer progress of file isn't visible. Is there any way through which it can be shown ??? The transfer progress ????

      Post the code where you call Net::OpenSSH constructor.

      Also, enable the module debugging mode and post the output here:

      $Net::OpenSSH::debug = -1;

        Hi Salva, thanks for the quick replies. PFB the output + constructor code.

        .... .... ....... for my $_entry (@_hosts) { eval { $_ssh{$_entry} = Net::OpenSSH->new($_entry, us +er=>$config{_ssh_user}, password=>$config{_ssh_passwd}, async => 1, master_opts => [-o => "St +rictHostKeyChecking=no"]); if($_ssh{$_entry}->error) { die CLI::Exception::SSHConnectExceptio +n->new() ; } else { $logger->debug("Successfully establis +hed SSH connection with ", $_entry); } }; if(catch my $_e) { if ($_e->isa('CLI::Exception')) { $logger->error($_e->description, " wit +h ", $_entry); print $_e->description." with $_entry +\n"; } } } if($_command eq "getfile") { for my $_entry (@_hosts) { $_pid{$_entry} = $_ssh{$_entry}->rsync_get({as +ync => 1, stderr_fh=>$fh, progress=> 1, recursive => 1}, "/home/shagu +n/check.c", "/home/shivangi/") or ($logger->error("rsync_get to $_entry failed") + and print "rsync_get to $_entry failed\n"); } } elsif($_command eq "putfile") { for my $_entry (@_hosts) { $_pid{$_entry} = $_ssh{$_entry}->rsync_put({as +ync => 1, stderr_fh=>$fh, recursive => 1, progress => 1 }, "/home/shi +vangi/shwetabh.img", "/home/shagun/") .... ... ... .. When i execute the code with debug mode enabled, output is: garfield:/home/shivangi/CLI_14/lib1 # ./ garfield>putfile region-group groupB # open_ex: ['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/r +oot-','-l','root','','--'] # _waitpid(3981) => pid: 3981, rc: # open_ex: ['rsync','-e','ssh -S /root/.libnet-openssh-perl/root-10.11 +2.35.43-3848-813787','--blocking-io','-q','--recursive','--progress', +'--','/home/shivangi/shwetabh.img','root@'] # open_ex: ['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/r +oot-','-l','root','','--'] # _waitpid(3984) => pid: 3984, rc: # open_ex: ['rsync','-e','ssh -S /root/.libnet-openssh-perl/root-10.11 +2.32.56-3848-476728','--blocking-io','-q','--recursive','--progress', +'--','/home/shivangi/shwetabh.img','root@'] # open_ex: ['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/ro +ot-','-l','root','','--'] # _waitpid(4236) => pid: 4236, rc: # open_ex: ['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/ro +ot-','-l','root','','--'] # _waitpid(4237) => pid: 4237, rc:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064577]
NodeReaper eyes the thorns in the side
Discipulus : the party puller!
[Discipulus]: I was trying to solve this but i'm not. my regex-fu is stuck at primary school

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-12-18 21:39 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (499 votes). Check out past polls.