secure remote backups

Jason Piterak
Tue, 27 Nov 2001 11:14:11 -0500

    Haven't had a chance to dig into rdiff-backup lately, been too busy with
other things. But, I tried your idea of negative --exclude regex parameters
to do positive matches (eg: backup all archive files) and couldn't get it to

Here's what I tried (regex courtesy of our local Perl guru):
 --exclude '^(.*?\.(?!(tar|rpm|tgz|gz|z|bz2|Z)).*?|[^\.]*?)$'

  Looking in the normal Python places I noticed that python has issues with
'\' characters in regex matching, especially when used as a quoted string in
the code:

Regular expressions use the backslash character ("\") to indicate special
forms or to allow special characters to be used without invoking their
special meaning. This collides with Python's usage of the same character for
the same purpose in string literals; for example, to match a literal
backslash, one might have to write '\\\\' as the pattern string, because the
regular expression must be "\\", and each backslash must be expressed as
"\\" inside a regular Python string literal.

The solution is to use Python's raw string notation for regular expression
patterns; backslashes are not handled in any special way in a string literal
prefixed with "r". So r"\n" is a two-character string containing "\" and
"n", while "\n" is a one-character string containing a newline. Usually
patterns will be expressed in Python code using this raw string notation.

... So, after looking at your regex call, and seeing that there was no 'r'
prefixing the string, I tried doing the \\ \\\\ substitutions, and still got

Any ideas?

Again, thanks for the trouble!

Jason Piterak
System Architect
CIS Technical Services
33 Main St., Suite 302
Nashua, NH 03064
(603) 889-4684 - FAX (603) 889-0534