From c3fd99b637bb8d48c2fc4eeaf526bfe1fb3fbfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu> Date: Tue, 16 Jan 2018 12:13:16 +0100 Subject: [PATCH] remove free space check as rsync_tmbackup will automatically purge old backups if no space is left, fixes #24052 --- tests/test_backup.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index da5287b6..388b1ad9 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -59,25 +59,6 @@ def test_last_backup_is_recent(server): return False -def test_backup_space(server=None, path="/backup"): - cmd = 'df -h %s | tail -n 1' % path - if server: - cmd = 'ssh -o StrictHostKeyChecking=no %s ' % server + cmd - status, out = subprocess.getstatusoutput(cmd) - if status == 0: - dev, total, used, free, used_perc, mount = out.strip().split() - used_perc = int(used_perc.replace('%', '')) - if used_perc > 80: - print('There is less than 20% of available space for backups') - return False - else: - print('There is %s%% of free space' % (100 - used_perc)) - return True - else: - print('Failed to check backup space') - return False - - def check_backup_is_incremental(path): # incremental backups done with tmbackup mean that they will all at least contain links dirs = os.listdir(path) @@ -130,7 +111,6 @@ def check_local_backups(paths): status, out = subprocess.getstatusoutput(cmd) for bf in out.split('\n'): all_ok = min(check_local_backup(bf), all_ok) - all_ok = min(test_backup_space(path=f), all_ok) return all_ok @@ -148,10 +128,7 @@ if os.path.isfile('../utils.py'): if not test_last_backup_is_recent(BACKUP_SERVER): sys.exit(1) else: - if not test_backup_space(server=BACKUP_SERVER): - sys.exit(1) - else: - sys.exit(0) + sys.exit(0) elif LOCAL_BACKUP_FOLDERS: sys.exit(not check_local_backups(LOCAL_BACKUP_FOLDERS)) else: -- GitLab