Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Net::OpenSSH rsync_get/rsync_put

by shivangi (Initiate)
on Nov 27, 2013 at 05:06 UTC ( #1064551=perlquestion: print w/replies, xml ) Need Help??
shivangi has asked for the wisdom of the Perl Monks concerning the following question:

Hello, i am using Net::OpenSSH library. I am using rsync_get /rsync_put function to transfer the file to /from remote host. I have used progress attribute of rsync to display the progress of file transfer, But it don't work.

.......... ........ ...... if($_command eq "getfile") { for my $_entry (@_hosts) { $_pid{$_entry} = $_ssh{$_entry}->rsync_get({as +ync => 1, progress => 1, recursive => 1}, "/home/shagun/test.img", "/home/shivan +gi/") or warn "rsync_get to $_entry failed\n"; } } elsif($_command eq "putfile") { for my $_entry (@_hosts) { $_pid{$_entry} = $_ssh{$_entry}->rsync_put({as +ync => 1, progress => 1, recursive => 1}, "/home/test.img", "/home/shagun/") or warn "rsync_put t +o $_entry failed\n"; } } else {...... ..... .....

Replies are listed 'Best First'.
Re: Net::OpenSSH rsync_get/rsync_put
by salva (Abbot) on Nov 27, 2013 at 08:31 UTC
    It works for me.

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

      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;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1064551]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2016-10-24 22:27 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (310 votes). Check out past polls.