Print info about progress

This commit is contained in:
bursa-pastoris 2022-05-07 18:28:54 +02:00
parent 173cfaa156
commit fa69c0f598
1 changed files with 4 additions and 0 deletions

View File

@ -27,17 +27,21 @@ def main():
if len(files) == 0:
# If path is a directory, create the directory in the restore path
if not os.path.exists(path.replace(FROM_MULTIVOL,TO,1)):
print("Restoring path \"{}\"... ".format(path), end="")
os.mkdir(path.replace(FROM_MULTIVOL,TO,1))
# The triple for the directory is generated before the triples
# for any of its subdirectories, so parents of current path
# will always exist
print("Done")
if len(dirs) == 0:
# If path is a file, recreate it the destination path
print("Restoring file \"{}\"... ".format(path), end="")
os.system('find "{path_to_find}" -type f -print0 | sort -zV | xargs -0 cat - > "{path_to_cat_to}"'
.format(path_to_find=path,
path_to_cat_to=path.replace(FROM_MULTIVOL,TO,1)
)
)
print("Done")
if __name__ == '__main__':