From f17af7f5ae90b867bddcdaf56c48b8e669dc244e Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Mon, 31 May 2021 06:24:51 -0600 Subject: [PATCH 1/2] Eliminate space in shebang Was causing dockerfile to fail to load --- mysql-backup-s3/backup.sh | 2 +- mysql-backup-s3/install.sh | 2 +- mysql-backup-s3/run.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-backup-s3/backup.sh b/mysql-backup-s3/backup.sh index eb604e4..4eca867 100644 --- a/mysql-backup-s3/backup.sh +++ b/mysql-backup-s3/backup.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh set -e diff --git a/mysql-backup-s3/install.sh b/mysql-backup-s3/install.sh index eda916a..4d1fc4f 100644 --- a/mysql-backup-s3/install.sh +++ b/mysql-backup-s3/install.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # exit if a command fails set -e diff --git a/mysql-backup-s3/run.sh b/mysql-backup-s3/run.sh index e3fb3c8..81c6224 100644 --- a/mysql-backup-s3/run.sh +++ b/mysql-backup-s3/run.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh set -e From 41188388cfbea35899385b58eff104035b2cac9d Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Mon, 31 May 2021 06:25:35 -0600 Subject: [PATCH 2/2] Use python3, remove go-cron, and use builtin cron --- mysql-backup-s3/install.sh | 11 +---------- mysql-backup-s3/run.sh | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mysql-backup-s3/install.sh b/mysql-backup-s3/install.sh index 4d1fc4f..1a2c772 100644 --- a/mysql-backup-s3/install.sh +++ b/mysql-backup-s3/install.sh @@ -3,23 +3,14 @@ # exit if a command fails set -e - apk update # install mysqldump apk add mysql-client # install s3 tools -apk add python py-pip +apk add python3 py3-pip pip install awscli -apk del py-pip - -# install go-cron -apk add curl -curl -L --insecure https://github.com/odise/go-cron/releases/download/v0.0.6/go-cron-linux.gz | zcat > /usr/local/bin/go-cron -chmod u+x /usr/local/bin/go-cron -apk del curl - # cleanup rm -rf /var/cache/apk/* diff --git a/mysql-backup-s3/run.sh b/mysql-backup-s3/run.sh index 81c6224..709c15d 100644 --- a/mysql-backup-s3/run.sh +++ b/mysql-backup-s3/run.sh @@ -9,5 +9,6 @@ fi if [ "${SCHEDULE}" = "**None**" ]; then sh backup.sh else - exec go-cron "$SCHEDULE" /bin/sh backup.sh + echo "$SCHEDULE /bin/sh /backup.sh" > /etc/crontabs/root + exec crond -d 8 -f fi