nysus has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use Net::OpenSSH's rsync_get method to download file excepts for those in a particular subdirectory. However, the exclude option seems to get ignored not matter what I try. I'm probably missing something obvious so I'm wondering if I can get second pair of eyes:

$self->rsync_get({exclude => 'sites', verbose => 1, recursive => 1, +copy_links => 1}, /home/websites/my_websites/, '/Users/me/tmp/site_f +iles');

The objective is to avoid downloading anything from /home/websites/my_websites/sites. I've tried both absolute and relative paths for the exclude argument and neither work.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: "exclude" option for Net::OpenSSH rsync_get method doesn't seem to work
by poj (Abbot) on Mar 02, 2017 at 21:20 UTC

    Did you try exclude => '/sites'
    poj

Re: "exclude" option for Net::OpenSSH rsync_get method doesn't seem to work
by nysus (Parson) on Mar 02, 2017 at 21:19 UTC

    Hmm, just realized the directory I want to exclude is actually a symbolic link to another directory. I got rid of the "copy_links" option and that solved it. Apparently it was overriding the exclude directive. Now to figure out a workaround.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

      "Now to figure out a workaround."

      It is called Configuration Management: Puppet, Chef, Salt, Ansible ... even cfEngine3.