<div dir="ltr">I'm trying to get rsync filters working -- and understood.<br><br>My current, simple test script is<br><br> ----------------------------------------------<br> #!/bin/bash<br><br> ROPTS="--verbose --progress --itemize-changes \<br>
--recursive \<br> --links \<br> --perms \<br> --times \<br> --group \<br> --owner \<br> --devices \<br> --specials \<br> --acls \<br> --xattrs \<br> --human-readable \<br> --numeric-ids \<br>
--relative \<br> --delete-after \<br> --delete-excluded \<br> --iconv=UTF-8,UTF-8 \<br> "<br><br> /usr/bin/rsync ${ROPTS} --filter="merge /home/test.filter" root@my.remote.com:/ /home/TEST<br>
----------------------------------------------<br><br>My 1st goal is to successfully filter to JUST backup "/boot", and all its contents, give a SRC entry point of "/".<br><br>If I populate the filter file,<br>
<br> cat << EOF >> /home/test.filter<br> + boot/<br> -sr /*<br> EOF<br><br>and exec the script, I end up with<br><br> ls -1 /home/TEST<br> boot/<br><br> du -h --max-depth=0 /home/TEST/boot/<br>
32M /home/TEST/boot/<br><br>where the boot/ IS fully recursively populated with its files & subdir contents.<br><br>So that works.<br><br>Next, I'd like to JUST backup two, specific subdirectories below /boot; specifically /boot/grub & /boot/grub2.<br>
<br>Changing the filter If I add a file exclusion to the filter<br><br> cat << EOF >> /home/test.filter<br> + boot/grub/<br> + boot/grub2/<br> -sr /*<br> EOF<br><br>and re-exec the script, now, nothing is rsync'd -- no files or dirs are transferred<br>
<br>Why doesn't the filter work for the subdirs?<br><br>How DO I filter to get just the subdirs of choice to rsync?<br><br><br></div>