diff --git a/backupbot.py b/backupbot.py index 7efae8f..ac7beb8 100755 --- a/backupbot.py +++ b/backupbot.py @@ -121,6 +121,9 @@ def copy_secrets(apps): container_id = container_by_service[s.name].id for sec in app_secs: src = f'/var/lib/docker/containers/{container_id}/mounts/secrets/{sec["SecretID"]}' + if not Path(src).exists(): + logging.error(f"For the secret {sec['SecretName']} the file {src} does not exist for {s.name}") + continue dst = SECRET_PATH + sec['SecretName'] copyfile(src, dst)