-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Greetings. I'm trying to make some backups using rsync, but I have some questions about it. First, on the receiving side, i make a test with this line. rsync -vv -e ssh --recursive --include-from=include.txt cmolina@www-01:/ /tmp/cmolina On include.txt I have. + etc + home/cmolina/source + home/cmolina + var/spool - - dev/ - - home/cmolina/ - - tmp/ - - root/ - - disk2/ - - home/ - - usr/ - - lib/ - - var/ - - bin/ - - boot/ - - dev/ - - etc/ - - floppy/ - - initrd/ - - lost+found - - proc/ - - opt/ - - sbin/ - - vmlinuz - - /* Note that the source path is /. Well, in resume, I'm trying to bypass the default rsync selection mechanism (include all the objects that aren't specified on the list), because we want to deny (exclude) all filenames, directories, archives, etc, and only permit the files, directories, SUBDIRECTORIES, that we specify on a include file. For example, we want to exclude anything, and only include the following directories (and it's contents) /etc /home/cmolina/source /home/cmolina /var/spool The problem is that rsync rejects to take it, because I have the - home/ directive on the include file. The conclusion, rsync takes the exclude/ include mechanism recursively. If rsync see that /home is exclude, it "marks" this directory and exclude all the /home dir and it's subdirs. Any one can help me on a rule that permit me exclude anything, but permit me the followings dirs (and sub dirs) /etc /home/cmolina/source /home/cmolina /var/spool On resume, exclude all, but include the specified. Thanks a lot. PD: I see a patch on the list that propose to use regexp with rsync. Will you include it on the following releases...?? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE95kMjho8byKxa2jgRAsMIAJ9tU33sIDFwwf/7OZx/fcX69FjeqwCfTiWt o+iXUVvX66uTzpLAK1cC0MQ=VmBn -----END PGP SIGNATURE-----
Carlos Molina <cmolina@net-uno.net> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Greetings. > > I'm trying to make some backups using rsync, but I have some questions > about it. > > First, on the receiving side, i make a test with this line. > > rsync -vv -e ssh --recursive --include-from=include.txt > cmolina@www-01:/ /tmp/cmolina > > On include.txt I have. > + etc > + home/cmolina/source > + home/cmolina > + var/spool > - - dev/ > - - home/cmolina/ > - - tmp/ > - - root/ > - - disk2/ > - - home/ > - - usr/ > - - lib/ > - - var/ > - - bin/ > - - boot/ > - - dev/ > - - etc/ > - - floppy/ > - - initrd/ > - - lost+found > - - proc/ > - - opt/ > - - sbin/ > - - vmlinuz > - - /*What are you tring to do with the double - signs?> Note that the source path is /. > > Well, in resume, I'm trying to bypass the default rsync selection > mechanism (include all the objects that aren't specified on the list), > because we want to deny (exclude) all filenames, directories, > archives, etc, and only permit the files, directories, > SUBDIRECTORIES, that we specify on a include file. > > For example, we want to exclude anything, and only include the > following directories (and it's contents) > > > /etc > /home/cmolina/source > /home/cmolina > /var/spoolIf you want everything under /home/cmolina, why is /home/cmolina/source also in your list? Anyway: + /etc + /home/cmolina + /var/spool - /* Max.
Carlos Molina <cmolina@net-uno.net> wrote:> + /etc > + /home/cmolina > + /var/log > - - /*Huh? "- -" ? Mistake again?> rsync isn't include directories under /home and /var, because it > exclude recursively on /*Well sure, but it would have included dirs under /home/cmolina and /var/log. The / in /* anchors to the toplevel. Works for me, and looks like it was working for you from the output you sent. Max.
Carlos Molina <cmolina@net-uno.net> wrote:> Nope, isn't works, because rsync only fetchs /etc directory. > On the output, you could see that /home nad /var is excluded (I > suppose that is excluded by /* pattern)Blah. Your right. This will work: + /etc + /home + /home/cmolina - /home/* + /var + /var/spool - /var/* - /*> Can you explain me with more detail what you refer with " > The / in /* anchors to the toplevel. > "/* will match <root-of-rsync>/foo, but not <root-of-rsync>/foo/bar. Of course, (and this is what I forgot), if <root>/foo is excluded, then rsync will never bother to look inside at <root>/foo/bar. Max.