Skip to content
Snippets Groups Projects
Commit 76d5f146 authored by Florent Thiéry's avatar Florent Thiéry
Browse files

cleanup all folders and not just one by one refs #23246

parent e302e397
No related branches found
No related tags found
No related merge requests found
......@@ -81,17 +81,17 @@ def test_backup_space(server=None, path="/backup"):
def check_backup_is_incremental(path):
# incremental backups done with tmbackup mean that they will all at least contain links
dirs = os.listdir(path)
is_incremental = True
for d in dirs:
files_count = 0
folder_path = os.path.join(path, d)
if os.path.isdir(folder_path):
files_count = len(os.listdir(folder_path))
if files_count == 0:
print('Folder %s is empty, this indicates non-incremental backups (we are expecting links)' % folder_path)
print('Folder %s is empty, this indicates non-incremental backups (we are expecting links), removing folder' % folder_path)
is_incremental = False
os.rmdir(folder_path)
print('Folder removed')
return False
return True
return is_incremental
def check_local_backup(path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment