Skip to content
Snippets Groups Projects
Commit c3fd99b6 authored by Florent Thiery's avatar Florent Thiery
Browse files

remove free space check as rsync_tmbackup will automatically purge old backups...

remove free space check as rsync_tmbackup will automatically purge old backups if no space is left, fixes #24052
parent 7c408ae1
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
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