Print info about progress
This commit is contained in:
parent
173cfaa156
commit
fa69c0f598
4
main.py
4
main.py
|
@ -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__':
|
||||
|
|
Reference in New Issue