bundles/backup-server: add metadata backup-client/one_backup_every_hours

This commit is contained in:
Franzi 2022-02-12 19:04:15 +01:00
parent 9a8e7abef4
commit 5d7872042b
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 12 additions and 3 deletions

View file

@ -7,6 +7,7 @@ from sys import argv, exit
from time import time
NODE = argv[1]
ONE_BACKUP_EVERY_HOURS = argv[2]
NOW = int(time())
DAY_SECONDS = 60 * 60 * 24
@ -45,9 +46,9 @@ try:
# One day without backups is still okay. There may be fluctuations
# because of transfer speed, amount of data, changes in backup
# schedule etc.
if delta > (DAY_SECONDS * 3):
if delta > (DAY_SECONDS * (ONE_BACKUP_EVERY_HOURS + 2)):
exit(2)
elif delta > (DAY_SECONDS * 2):
elif delta > (DAY_SECONDS * (ONE_BACKUP_EVERY_HOURS + 1)):
exit(1)
else:
exit(0)