Hi. I hope this isn't a FAQ.... I'm using BackupPC to backup a linux
system to an external drive using rsync. It works nicely. I have
some large data files that don't need backing up, though. I was
wondering if it's possible to exclude (prune) directories by doing
something like putting a dot-file (".DONT_BACKUP") in them. That
would make it easy to flag directories on the fly as not needing to be
backed up. I understand I can edit the config file and place an entry
in BackupFilesExclude; this would just be a convenience. (It might be
more than a convenience for people who don't have root access.)
Rsync supports precisely what you want: place the following item into
your RsyncArgs argument list (the name .rsyncPerDirFilter is just a name
choosen for this example - but the space between the : and the name is
mandatory, possibly needs to be backslashed).
In each directory where a user wants files to be excluded, he can create
a file of that name, with a content like
to exclude all files/directories that match one of the patterns (be
carefull, rsync reads these lines one after the other and triggers on
the first match it finds - later matches are not seen, even if they
would be more restrictive). Have a look at the "INCLUDE/EXCLUDE PATTERN
RULES" in the rsync man page.
I found this slightly dangerous - you introduce a filter file and than
forget about it or dont tell about it ...
On Tue, Jan 27, 2009 at 1:36 AM, Juergen Harms <Juergen.Harms@...> wrote:
> Rsync supports precisely what you want: place the following item into
> your RsyncArgs argument list (the name .rsyncPerDirFilter is just a name
> choosen for this example - but the space between the : and the name is
> mandatory, possibly needs to be backslashed).
> --filter=: .rsyncPerDirFilter
Thanks, Juergen! I will look into that option. The danger of using
it is duly noted!
Get latest updates about Open Source Projects, Conferences and News.