forked from coop-cloud/backup-bot-two
Always backup all apps to increase restic performance
This commit is contained in:
parent
ff2b5a25a2
commit
c73bbe8c0d
|
@ -87,8 +87,10 @@ def get_backup_cmds():
|
||||||
labels = s.attrs['Spec']['Labels']
|
labels = s.attrs['Spec']['Labels']
|
||||||
if (backup := labels.get('backupbot.backup')) and bool(backup):
|
if (backup := labels.get('backupbot.backup')) and bool(backup):
|
||||||
stack_name = labels['com.docker.stack.namespace']
|
stack_name = labels['com.docker.stack.namespace']
|
||||||
if SERVICE and SERVICE != stack_name:
|
# Remove this lines to backup only a specific service
|
||||||
continue
|
# This will unfortenately decrease restice performance
|
||||||
|
# if SERVICE and SERVICE != stack_name:
|
||||||
|
# continue
|
||||||
backup_apps.add(stack_name)
|
backup_apps.add(stack_name)
|
||||||
backup_paths = backup_paths.union(
|
backup_paths = backup_paths.union(
|
||||||
Path(VOLUME_PATH).glob(f"{stack_name}_*"))
|
Path(VOLUME_PATH).glob(f"{stack_name}_*"))
|
||||||
|
@ -104,6 +106,7 @@ def get_backup_cmds():
|
||||||
|
|
||||||
|
|
||||||
def copy_secrets(apps):
|
def copy_secrets(apps):
|
||||||
|
#TODO: check if it is deployed
|
||||||
rmtree(SECRET_PATH, ignore_errors=True)
|
rmtree(SECRET_PATH, ignore_errors=True)
|
||||||
os.mkdir(SECRET_PATH)
|
os.mkdir(SECRET_PATH)
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
|
|
Loading…
Reference in New Issue