RmdirFailing

From RdiffBackupWiki

Jump to: navigation, search

I'm using rdiff-backup to backup from OS X to a Linux server via NFS. Doing so I'm experiencing failing backups because rmdir() is not able to remove directories that are not empty/seem to be not empty.

I found the following changes to rpath.py on the mailing list but none of them was able to solve my problem though it seems as if the problem has something to do with operations on the filesystem that are not executed chronologically. :-( (http://lists.gnu.org/archive/html/rdiff-backup-users/2004-01/msg00052.html)

Solution I:

def rmdir(self):
  log.Log("Removing directory " + self.path, 6)
  #self.conn.os.rmdir(self.path)
  try: self.conn.os.rmdir(self.path)
    except os.error: shutil.rmtree(self.path)
  self.data =3D {'type': None}

Solution II:

def rmdir(self):
  log.Log("Removing directory " + self.path, 6)
  #self.conn.os.rmdir(self.path)
  try: self.conn.os.rmdir(self.path)
    except os.error:
    self.fsync()
    self.conn.os.rmdir(self.path)
  self.data =3D {'type': None}

rdiff-backup was failing to close a file, which may have triggered the NFS error. Versions 1.0.3/1.1.3 or later fix this problem.

Personal tools