Skip to main content
Sign in
Snippets Groups Projects
Commit 3a581ef7 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Improve symlink handling. Add missing import of shutil.

parent b685d7d6
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import os
import socket
import subprocess
import time
import shutil
def cond_unlink(path, log):
try:
......@@ -88,10 +89,11 @@ class Backup:
dst.uid, dst.gid)
os.lchown(dst_path, int(src.uid), int(src.gid))
changed = True
if src.kind == b'F' and src.mtime != dst.mtime:
if src.kind in [ b'F', b'L' ] and src.mtime != dst.mtime:
self.log.DEBUG('MTIME', src.name, src.mtime, dst.mtime)
atime = os.stat(dst_path).st_atime
os.utime(dst_path, (int(atime), int(src.mtime)))
atime = os.lstat(dst_path).st_atime
os.utime(dst_path, (int(atime), int(src.mtime)),
follow_symlinks=False)
changed = True
if changed:
self.status.metadata += 1
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment