Resync of rdiff-backup directories

Jason Piterak Jason_Piterak@c-i-s.com
Mon, 4 Feb 2002 16:55:41 -0500


Hi Ben,
  Some nice changes the last few revs (especially like the restore from
remote server). Hope everything is going well. Had another idea for you...

1) Create a --force-resync option:
  One of the great reasons for using rdiff-backup is to do backups of remote
machines across slow links. The problem is that the FIRST rdiff-backup of
the data requires a complete copy of all data to the remote location,
something that may not be feasible, depending on the speed of the WAN link.
  One option to get around this is to make an initial copy of the data from
the remote location, and transport this to the backup server via some sort
of removable media. The problem then becomes that rdiff-backup recognizes
that there is data in the remote destination, but does not recognize this
data as being an rdiff-backup destination directory. The error you get is:

Fatal Error: Destination directory jp_misc-bu/ exists, but does not look
like a
rdiff-backup directory.  Running rdiff-backup like this could mess up
what is currently in it.  If you want to overwrite it, run
rdiff-backup with the --force option. 

  Running the --force option forces an overwrite of the contents of the
directory (obviously what we were trying to avoid!).

  However, if you create an rdiff-backup-data directory, and a 'fake'
.snapshot file:
   [jpiterak@sasherlinux testdir]$ mkdir /jp_misc-bu/rdiff-backup-data
   [jpiterak@sasherlinux testdir]$ touch
/jp_misc-bu/rdiff-backup-data/current_mirror.2002-02-04T12:36:22-04:00.snaps
hot
   [jpiterak@sasherlinux testdir]$ ls -al jp_misc-bu/rdiff-backup-data/
    total 8
    drwxrwxr-x    2 jpiterak jpiterak     4096 Feb  4 12:54 ./
    drwxrwxr-x    7 jpiterak jpiterak     4096 Dec 27 09:49 ../
    -rw-------    1 jpiterak jpiterak        0 Feb  4 12:50
current_mirror.2002-02-04T12:50:27-04:00.snapshot

  ... Then rdiff-backup judges this to be a valid rdiff-backup destination
directory, and continues merrily along, running the rdiff checksums, and
only updating files that are different.

  So... To simplify this process, how about an option to resync two
directories (eg: --force-resync)?


----------------
  Also... How goes the multi-source programming? Any word on how you plan to
implement? Some ideas...
  Source: accept file list from stdin, from file --> from FIFO
  Filters: Allow per-source --include and --exclude filters, with perl regex
syntax

  With regards to your note in the man page on quoting the '\', something
that may or may not be useful (from the Python re library notes):

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.

Take care,

  --Jason

---
Jason Piterak