rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] Force a regression of rdiff-backup archive


From: Dominic Raferd
Subject: Re: [rdiff-backup-users] Force a regression of rdiff-backup archive
Date: Tue, 18 Jan 2011 16:52:30 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

This must be almost a record snail-wise for a newsgroup correspondence (my original posting June 2009, Janne's reply Feb 2010, this reply Jan 2011), but by way of a very belated thank you to Janne for his suggestion, and using his technique, I attach a bash script which automates the process of forcibly regressing an rdiff-backup repository.

Help is built in, just run the script without parameters to see. It does a single step regression, it can be run multiple times if you need to regress the repository back further. All the usual caveats apply.

Dominic

On 23/02/2010 10:39, Janne Peltonen wrote:
Hi!

I don't know if you solved your problem already some another way, but I thought
it'd be nice to tell what I do in situation like this, anyway.

Without looking at the source, it appears that rdiff-backup decides whether a
regression is in order by checking whether there are two current_mirror stamps
(one for the supposedly failed backup, the other for the previous, successful
backup). So you can force a regression to the previous version by creating a
new current_mirror stamp file in the destdir/rdiff-backup-data directory. (The
file contains the word "PID", a space, and the pid of the rdiff-backup process
that created the version, but the contents aren't that interesting in this
case; you can just copy the existing current_mirror file.) The timestamp in the
file name of the current_mirror file must match the timestamp of the previous
backup, the one you want to regress to (you can only regress to the previous
backup, don't try to skip versions).

An example might be in order:

--clip--
varma:/backup/data/aulis/rdiff-backup-data# ls -ltr mirror_metadata*|tail -n2
-rw------- 1 root root    7243 21.2. 02:49 
mirror_metadata.2010-02-20T01:00:20+02:00.diff.gz
-rw------- 1 root root 5453359 23.2. 12:07 
mirror_metadata.2010-02-21T01:00:21+02:00.snapshot.gz
varma:/backup/data/aulis/rdiff-backup-data# cp 
current_mirror.2010-02-21T01:00:21+02:00.data 
current_mirror.2010-02-20T01:00:20+02:00.data
varma:/backup/data/aulis/rdiff-backup-data# rdiff-backup 
--check-destination-dir /backup/data/aulis
--clip--

Depending on your version of rdiff-backup and the exact situation, you might
get an error like this:

--clip--
Exception 'RPath instance has no attribute 'inc_compressed'' raised of class 
'exceptions.AttributeError':
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 295, in 
error_check_Main
     try: Main(arglist)
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 315, in 
Main
     take_action(rps)
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 273, in 
take_action
     elif action == "check-destination-dir": CheckDest(rps[0])
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 781, in 
CheckDest
     dest_rp.conn.regress.Regress(dest_rp)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 69, 
in Regress
     regress_rbdir(manager)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 124, 
in regress_rbdir
     if has_meta_diff and not has_meta_snap: recreate_meta(meta_manager)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 145, 
in recreate_meta
     writer = metadata.MetadataFile(temprp, 'w', check_path = 0)
   File "/var/lib/python-support/python2.4/rdiff_backup/metadata.py", line 378, 
in __init__
     if compress and not rp_base.isinccompressed():
   File "/var/lib/python-support/python2.4/rdiff_backup/rpath.py", line 1087, 
in isinccompressed
     return self.inc_compressed

Traceback (most recent call last):
   File "/usr/bin/rdiff-backup", line 23, in ?
     rdiff_backup.Main.error_check_Main(sys.argv[1:])
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 295, in 
error_check_Main
     try: Main(arglist)
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 315, in 
Main
     take_action(rps)
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 273, in 
take_action
     elif action == "check-destination-dir": CheckDest(rps[0])
   File "/var/lib/python-support/python2.4/rdiff_backup/Main.py", line 781, in 
CheckDest
     dest_rp.conn.regress.Regress(dest_rp)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 69, 
in Regress
     regress_rbdir(manager)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 124, 
in regress_rbdir
     if has_meta_diff and not has_meta_snap: recreate_meta(meta_manager)
   File "/var/lib/python-support/python2.4/rdiff_backup/regress.py", line 145, 
in recreate_meta
     writer = metadata.MetadataFile(temprp, 'w', check_path = 0)
   File "/var/lib/python-support/python2.4/rdiff_backup/metadata.py", line 378, 
in __init__
     if compress and not rp_base.isinccompressed():
   File "/var/lib/python-support/python2.4/rdiff_backup/rpath.py", line 1087, 
in isinccompressed
     return self.inc_compressed
AttributeError: RPath instance has no attribute 'inc_compressed'
--clip--

You can solve it by editing

   /var/lib/python-support/python2.4/rdiff_backup/metadata.py

and changing line 378 to

   if compress and rp_base.isincfile() and not rp_base.isinccompressed():

and then running rdiff-backup --check-destination-dir again.

After rdiff-backup returns, the backup should be regressed to the previous
version (and have only one current_mirror file). You can repeat the process,
one varsion at a time, for as many times as you wish. So if you want to regress
two versions, just repeat the process once.


--Janne

Attachment: rdiff-backup-regress
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]