Você marcou sua pergunta com perl
so ...
Use Net :: OpenSSH :
#!/usr/bin/perl
use strict;
use Net::OpenSSH;
my $ssh = Net::OpenSSH->new(user => $user, password => $password);
$ssh->rsync_get({verbose => 1}, $remote_directory, $local_directory)
or die $ssh->error;