Commit 731d346b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add path when dealing with changed files...

parent b778cecc
......@@ -68,28 +68,29 @@ class Backup:
def check(self, src, dst):
if !=
raise Exception('Names differ: %s, %s' % (src, dst))
dst_path = os.path.join(self.dst_root,
if src.kind != dst.kind or src.md5 != dst.md5 or src.size != dst.size:
src.md5, dst.md5, src.size, dst.size)
self.status.replaced += 1
elif os.path.exists(
elif os.path.exists(dst_path):
changed = False
if src.kind in [ 'F', 'D'] and src.mode != dst.mode:
if src.kind in [ b'F', b'D'] and src.mode != dst.mode:
self.log.DEBUG('MODE',, src.mode, dst.mode)
os.chmod(, int(src.mode, 8))
os.chmod(dst_path, int(src.mode, 8))
changed = True
if (src.kind in [ 'F', 'D'] and
src.uid != dst.uid or src.gid != dst.gid):
if (src.kind in [ b'F', b'D'] and
(src.uid != dst.uid or src.gid != dst.gid)):
self.log.DEBUG('UID/GID',, src.uid, src.gid,
dst.uid, dst.gid)
os.lchown(, int(src.uid), int(src.gid))
os.lchown(dst_path, int(src.uid), int(src.gid))
changed = True
if src.kind == 'F' and src.mtime != dst.mtime:
if src.kind == b'F' and src.mtime != dst.mtime:
self.log.DEBUG('MTIME',, src.mtime, dst.mtime)
atime = os.stat(
os.utime(, (int(atime), int(src.mtime)))
atime = os.stat(dst_path).st_atime
os.utime(dst_path, (int(atime), int(src.mtime)))
changed = True
if changed:
self.status.metadata += 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment