mirror of https://github.com/borgbackup/borg.git
save mountpoint dirs, fixes #1033
This commit is contained in:
parent
02e229b255
commit
2b454fc54b
|
@ -324,9 +324,10 @@ class Archiver:
|
||||||
return
|
return
|
||||||
if (st.st_ino, st.st_dev) in skip_inodes:
|
if (st.st_ino, st.st_dev) in skip_inodes:
|
||||||
return
|
return
|
||||||
# Entering a new filesystem?
|
# if restrict_dev is given, we do not want to recurse into a new filesystem,
|
||||||
if restrict_dev is not None and st.st_dev != restrict_dev:
|
# but we WILL save the mountpoint directory (or more precise: the root
|
||||||
return
|
# directory of the mounted filesystem that shadows the mountpoint dir).
|
||||||
|
recurse = restrict_dev is None or st.st_dev == restrict_dev
|
||||||
status = None
|
status = None
|
||||||
# Ignore if nodump flag is set
|
# Ignore if nodump flag is set
|
||||||
try:
|
try:
|
||||||
|
@ -344,28 +345,30 @@ class Archiver:
|
||||||
status = 'E'
|
status = 'E'
|
||||||
self.print_warning('%s: %s', path, e)
|
self.print_warning('%s: %s', path, e)
|
||||||
elif stat.S_ISDIR(st.st_mode):
|
elif stat.S_ISDIR(st.st_mode):
|
||||||
tag_paths = dir_is_tagged(path, exclude_caches, exclude_if_present)
|
if recurse:
|
||||||
if tag_paths:
|
tag_paths = dir_is_tagged(path, exclude_caches, exclude_if_present)
|
||||||
if keep_tag_files and not dry_run:
|
if tag_paths:
|
||||||
archive.process_dir(path, st)
|
if keep_tag_files and not dry_run:
|
||||||
for tag_path in tag_paths:
|
archive.process_dir(path, st)
|
||||||
self._process(archive, cache, matcher, exclude_caches, exclude_if_present,
|
for tag_path in tag_paths:
|
||||||
keep_tag_files, skip_inodes, tag_path, restrict_dev,
|
self._process(archive, cache, matcher, exclude_caches, exclude_if_present,
|
||||||
read_special=read_special, dry_run=dry_run)
|
keep_tag_files, skip_inodes, tag_path, restrict_dev,
|
||||||
return
|
read_special=read_special, dry_run=dry_run)
|
||||||
|
return
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
status = archive.process_dir(path, st)
|
status = archive.process_dir(path, st)
|
||||||
try:
|
if recurse:
|
||||||
entries = helpers.scandir_inorder(path)
|
try:
|
||||||
except OSError as e:
|
entries = helpers.scandir_inorder(path)
|
||||||
status = 'E'
|
except OSError as e:
|
||||||
self.print_warning('%s: %s', path, e)
|
status = 'E'
|
||||||
else:
|
self.print_warning('%s: %s', path, e)
|
||||||
for dirent in entries:
|
else:
|
||||||
normpath = os.path.normpath(dirent.path)
|
for dirent in entries:
|
||||||
self._process(archive, cache, matcher, exclude_caches, exclude_if_present,
|
normpath = os.path.normpath(dirent.path)
|
||||||
keep_tag_files, skip_inodes, normpath, restrict_dev,
|
self._process(archive, cache, matcher, exclude_caches, exclude_if_present,
|
||||||
read_special=read_special, dry_run=dry_run)
|
keep_tag_files, skip_inodes, normpath, restrict_dev,
|
||||||
|
read_special=read_special, dry_run=dry_run)
|
||||||
elif stat.S_ISLNK(st.st_mode):
|
elif stat.S_ISLNK(st.st_mode):
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
if not read_special:
|
if not read_special:
|
||||||
|
|
Loading…
Reference in New Issue