bundles/backup-server: add metadata backup-client/one_backup_every_hours
This commit is contained in:
parent
9a8e7abef4
commit
5d7872042b
3 changed files with 12 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue