Here is my rsync command as it currently stands. /usr/local/bin/rsync -vvv --stats -Pzrtpl --delete --password-file=/export/home/webuser/.appprod --log-file=/export/home/webuser/logs/rsync-log -F /export/home/ webuser at appprod::dprweb_extranet/ > rsync-test Here is the current .rsync-filter file. + das + em + enf + internal + itb + medtox + pml + psb + reg + whs + htdocs + docs - /* - das/* - em/* - enf/* - internal/* - itb/* - medtox/* - pml/* - psb/* - reg/* - whs/* - htdocs/* This is doing pretty close to what I want it to do. Which is to mirror only the */htdocs/docs* in each of the ten directories (das,em,enf,etc.) in the base path of */export/home* and exclude the rest. Unfortunately there are some subdirectories in some of these selected */htdocs/docs* directories that are unintentionally being excluded by these rules. I.E. */export/home/enf/htdocs/docs/county/internal/*. [sender] hiding file enf/htdocs/docs/county/internal/gis0402.pdf because of pattern internal/* [per-dir .rsync-filter] [sender] hiding file enf/htdocs/docs/county/internal/gis1201.pdf because of pattern internal/* [per-dir .rsync-filter] [sender] hiding directory enf/htdocs/docs/county/internal/gis1201 because of pattern internal/* [per-dir .rsync-filter] [sender] hiding directory enf/htdocs/docs/county/internal/gis0402 because of pattern internal/* [per-dir .rsync-filter] Is there an easy way to remedy this in the base .rsync-filter file and|or the rsync command? Someway to say only exclude the base */export/home/internal/* directory, not any lower "internal" directories? OR is the only way to create sub .rsync-filter files in other directories? My concern with the latter option is that users are in control of these directories and can add and modify them at will. If I find all the special cases today, this is no guarantee that there won't be more special cases tomorrow.
In <4CA449EA.2858.00AF.0 at cdpr.ca.gov>, on 09/30/10 at 08:27 AM, "Ian Skinner" <iskinner at cdpr.ca.gov> said: Hi,>Here is my rsync command as it currently stands.>/usr/local/bin/rsync -vvv --stats -Pzrtpl --delete >--password-file=/export/home/webuser/.appprod >--log-file=/export/home/webuser/logs/rsync-log -F /export/home/ >webuser at appprod::dprweb_extranet/ > rsync-test>This is doing pretty close to what I want it to do. Which is to mirror >only the */htdocs/docs* in each of the ten directories (das,em,enf,etc.) >in the base path of */export/home* and exclude the rest.I'm not sure I entirely understand what you want, but what about + das/**/htdocs/docs* + em/**/htdocs/docs* etc. or possibly + das/**htdocs/docs* + em/**/htdocs/docs* etc. I'm not sure if the addtional slash is required without setting up a testcase. If you really want just the files matching */htdocs/docs/*, the above needs to change slightly. Steven -- ---------------------------------------------------------------------- "Steven Levine" <steve53 at earthlink.net> eCS/Warp/DIY etc. www.scoug.com www.ecomstation.com ----------------------------------------------------------------------
On Thu, Sep 30, 2010 at 8:27 AM, Ian Skinner <iskinner at cdpr.ca.gov> wrote:> Unfortunately there are some subdirectories in some of these selected > */htdocs/docs* directories that are unintentionally being excluded by these > rules. I.E. */export/home/enf/htdocs/docs/county/internal/*.It is usually best to anchor your matching terms, unless you want a term to float and match anywhere. In an .rsync-filter file, terms that start with a slash are anchored in that file's directory. You can also use a wildcard for all the subdir excusions. For example:> + /das> + /em> + /enf> + /internal> + /itb> + /medtox> + /pml> + /psb> + /reg> + /whs> - /*>+ /*/htdocs - /*/* + /*/htdocs/docs> - /*/htdocs/*Another alternative is to sprinkle .rsync-filter files throughout your hierarchy with localized rules for that part of the hierarchy, but the above should do what you want. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20101001/b9df535b/attachment.html>
>>> On Friday, October 01, 2010 at 7:54 AM, in message >> + /das >> + /em >> + /enf >> + /internal >> + /itb >> + /medtox >> + /pml >> + /psb >> + /reg >> + /whs >> - /* >> > + /*/htdocs > - /*/* > > + /*/htdocs/docs >> - /*/htdocs/*Thanks Wayne, this worked well and seems simpler and lazier then my original version.