[Top][All Lists]

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

Re: [rdiff-backup-users] Problems with failed backups and 0.11.4

From: Ben Escoto
Subject: Re: [rdiff-backup-users] Problems with failed backups and 0.11.4
Date: Mon, 23 Jun 2003 23:42:13 -0700

>>>>> "RP" == Roland Pope <address@hidden>
>>>>> wrote the following on Thu, 5 Jun 2003 16:53:38 +1200

  RP> Hi, I am doing some testing with rdiff-backup 0.11.4 between two
  RP> RedHat 9 boxes over SSH and I am having some issues trying to
  RP> kick off another backup after one failed with the following
  RP> error:

Thinking about your problem again, you may want to try this patch:

--- restore.py.old      2003-06-23 23:21:58.000000000 -0700
+++ restore.py  2003-06-23 23:37:15.000000000 -0700
@@ -20,7 +20,7 @@
 """Read increment files and restore to original"""
 from __future__ import generators
-import tempfile, os
+import tempfile, os, cStringIO
 import Globals, Time, Rdiff, Hardlink, rorpiter, selection, rpath, \
           log, static, robust, metadata, statistics, TempFile
@@ -381,8 +381,16 @@
        def get_restore_fp(self):
                """Return file object of restored data"""
-               assert self.relevant_incs[-1].isreg(), \
-                          (mirror_rp.index, self.relevant_incs[-1].lstat())
+               if not self.relevant_incs[-1].isreg():
+                       log.Log("""Warning: Could not restore file %s!
+A regular file was indicated by the metadata, but could not be
+constructed from existing increments because last increment had type
+%s.  Instead of the actual file's data, an empty length file will be
+created.  This error is probably caused by data loss in the
+rdiff-backup destination directory, or a bug in rdiff-backup""" %
+                                       (self.mirror_rp.path, 
self.relevant_incs[-1].lstat()), 2)
+                       return cStringIO.StringIO('')
                current_fp = self.get_first_fp()
                for inc_diff in self.relevant_incs[1:]:
                        log.Log("Applying patch %s" % 
(inc_diff.get_indexpath(),), 7)

It won't fix your problem, but it does keep rdiff-backup from giving
up because it can't restore that one regular file.  But I still don't
know what the original error is, or why that regular file can't be
restored.  If you can reproduce that error somehow that would be great
(as in, given that there is an error, ceteris paribus reproducibility
is good).

Ben Escoto

Attachment: pgpChmW4Y7jSu.pgp
Description: PGP signature

reply via email to

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