From f6d1da8899942c7504e4dfad6c6cacaaac2a2849 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Thu, 11 Nov 2021 02:10:17 +0200 Subject: [PATCH] Working cron again, d'oh --- README.md | 6 ++++-- compose.ssh.yml | 1 - compose.swarmm-cronjob.yml | 1 + setup-cron.sh | 5 ++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 683034e..19485ce 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,13 @@ Automatically take backups from running Docker Swarm services into a volume. ## Background -There are lots of Docker volume backup systems; all of them have one or both of these problems: +There are lots of Docker volume backup systems; all of them have one or both of these limitations: - You need to define all the volumes to back up in the configuration system - Backups require services to be stopped to take consistent copies -Backupbot II tries to solve these problems by **letting you define how to back up your services using Docker labels**, so you can **easily collect your backups for use with another system** like docker-volume-backup. +Backupbot II tries to help, by +1. **letting you define backups using Docker labels**, so you can **easily collect your backups for use with another system** like docker-volume-backup. +2. **running pre- and post-commands** before and after backups, for example to use database tools to take a backup from a running service. ## Deployment diff --git a/compose.ssh.yml b/compose.ssh.yml index 1bd2909..d6b68f3 100644 --- a/compose.ssh.yml +++ b/compose.ssh.yml @@ -9,7 +9,6 @@ services: secrets: - source: ssh_key mode: 0400 - entrypoint: [ "/usr/bin/backup.sh" ] secrets: ssh_key: diff --git a/compose.swarmm-cronjob.yml b/compose.swarmm-cronjob.yml index df997e0..b0fde90 100644 --- a/compose.swarmm-cronjob.yml +++ b/compose.swarmm-cronjob.yml @@ -12,3 +12,4 @@ services: # Note(3wc): blank label to be picked up by `abra recipe sync` restart_policy: condition: none + entrypoint: [ "/usr/bin/backup.sh" ] diff --git a/setup-cron.sh b/setup-cron.sh index 6864b67..dfa2f53 100644 --- a/setup-cron.sh +++ b/setup-cron.sh @@ -5,7 +5,6 @@ set -o pipefail cron_schedule="${CRON_SCHEDULE:?CRON_SCHEDULE not set}" -echo "$cron_schedule /usr/bin/backup.sh" | crontab - -crontab -l +echo "$cron_schedule /usr/bin/backup.sh" > /etc/crontabs/root -crond -f -L /dev/stdout +crond -f -d8 -L /dev/stdout