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

do not attempt to count resources, since it will be very slow and will be...

do not attempt to count resources, since it will be very slow and will be mediaserver specific, so unusable for generic backups, refs #23246
parent 5372be3d
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@ import os
import socket
import subprocess
import sys
import glob
GREEN = '\033[92m'
RED = '\033[91m'
......@@ -80,18 +79,14 @@ 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)
dirs.sort()
for d in dirs:
num_folders = 0
files_count = 0
folder_path = os.path.join(path, d)
if os.path.isdir(folder_path):
media = glob.glob(os.path.join(path, d, "*/msinstance/media/resources/"))
for m in media:
num_folders += len(os.listdir(m))
print('%s: %s' % (d, num_folders))
if num_folders == 0:
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)
os.rmdir(folder_path)
print('Folder removed')
......
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