save mountpoint dirs, fixes #1033

This commit is contained in:
Thomas Waldmann 2016-07-31 00:25:53 +02:00
parent 02e229b255
commit 2b454fc54b
1 changed files with 26 additions and 23 deletions

View File

@ -324,9 +324,10 @@ class Archiver:
return
if (st.st_ino, st.st_dev) in skip_inodes:
return
# Entering a new filesystem?
if restrict_dev is not None and st.st_dev != restrict_dev:
return
# if restrict_dev is given, we do not want to recurse into a new filesystem,
# but we WILL save the mountpoint directory (or more precise: the root
# directory of the mounted filesystem that shadows the mountpoint dir).
recurse = restrict_dev is None or st.st_dev == restrict_dev
status = None
# Ignore if nodump flag is set
try:
@ -344,6 +345,7 @@ class Archiver:
status = 'E'
self.print_warning('%s: %s', path, e)
elif stat.S_ISDIR(st.st_mode):
if recurse:
tag_paths = dir_is_tagged(path, exclude_caches, exclude_if_present)
if tag_paths:
if keep_tag_files and not dry_run:
@ -355,6 +357,7 @@ class Archiver:
return
if not dry_run:
status = archive.process_dir(path, st)
if recurse:
try:
entries = helpers.scandir_inorder(path)
except OSError as e: