From 5b889197464a23fc45f88adcede320d04b321260 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 26 Sep 2022 13:02:38 +0200 Subject: Move cryptpad backup job to backup-daily.hcl --- cluster/prod/app/backup/deploy/backup-daily.hcl | 45 +++++++++++++++++ .../backup/cryptpad/backup_aws_access_key_id | 1 + .../backup/cryptpad/backup_aws_secret_access_key | 1 + .../secrets/backup/cryptpad/backup_restic_password | 1 + .../backup/cryptpad/backup_restic_repository | 1 + cluster/prod/app/cryptpad/deploy/backup.hcl | 57 ---------------------- .../cryptpad_backup/backup_aws_access_key_id | 1 - .../cryptpad_backup/backup_aws_secret_access_key | 1 - .../secrets/cryptpad_backup/backup_restic_password | 1 - .../cryptpad_backup/backup_restic_repository | 1 - restic-summary | 2 +- 11 files changed, 50 insertions(+), 62 deletions(-) create mode 100644 cluster/prod/app/backup/secrets/backup/cryptpad/backup_aws_access_key_id create mode 100644 cluster/prod/app/backup/secrets/backup/cryptpad/backup_aws_secret_access_key create mode 100644 cluster/prod/app/backup/secrets/backup/cryptpad/backup_restic_password create mode 100644 cluster/prod/app/backup/secrets/backup/cryptpad/backup_restic_repository delete mode 100644 cluster/prod/app/cryptpad/deploy/backup.hcl delete mode 100644 cluster/prod/app/cryptpad/secrets/cryptpad_backup/backup_aws_access_key_id delete mode 100644 cluster/prod/app/cryptpad/secrets/cryptpad_backup/backup_aws_secret_access_key delete mode 100644 cluster/prod/app/cryptpad/secrets/cryptpad_backup/backup_restic_password delete mode 100644 cluster/prod/app/cryptpad/secrets/cryptpad_backup/backup_restic_repository diff --git a/cluster/prod/app/backup/deploy/backup-daily.hcl b/cluster/prod/app/backup/deploy/backup-daily.hcl index df592ce..10020f2 100644 --- a/cluster/prod/app/backup/deploy/backup-daily.hcl +++ b/cluster/prod/app/backup/deploy/backup-daily.hcl @@ -193,4 +193,49 @@ EOH } } } + + group "backup-cryptpad" { + constraint { + attribute = "${attr.unique.hostname}" + operator = "=" + value = "courgette" + } + + task "main" { + driver = "docker" + + config { + image = "restic/restic:0.12.1" + entrypoint = [ "/bin/sh", "-c" ] + args = [ "restic backup /cryptpad && restic forget --keep-within 1m1d --keep-within-weekly 3m --keep-within-monthly 1y && restic prune --max-unused 50% --max-repack-size 2G && restic check" ] + volumes = [ + "/mnt/storage/cryptpad:/cryptpad" + ] + } + + template { + data = <