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 # ./Application.pl garfield>putfile region-group groupB # open_ex: ['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/r +oot-10.112.35.43-3848-813787','-l','root','10.112.35.43','--'] # _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@10.112.35.43:/home/shagun/'] # open_ex: ['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/r +oot-10.112.32.56-3848-476728','-l','root','10.112.32.56','--'] # _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@10.112.32.56:/home/shagun/'] # open_ex: ['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/ro +ot-10.112.35.43-3848-813787','-l','root','10.112.35.43','--'] # _waitpid(4236) => pid: 4236, rc: # open_ex: ['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/ro +ot-10.112.32.56-3848-476728','-l','root','10.112.32.56','--'] # _waitpid(4237) => pid: 4237, rc:

In reply to Re^4: Net::OpenSSH rsync_get/rsync_put by shivangi
in thread Net::OpenSSH rsync_get/rsync_put by shivangi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.