Skip to content

Commit

Permalink
Merge pull request #136 from iloveitaly/fix-mysql
Browse files Browse the repository at this point in the history
Fix mysql backup
  • Loading branch information
iloveitaly authored Jun 15, 2021
2 parents 27016fe + 4118838 commit 588291b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mysql-backup-s3/backup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/sh

set -e

Expand Down
13 changes: 2 additions & 11 deletions mysql-backup-s3/install.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#! /bin/sh
#!/bin/sh

# 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/*
5 changes: 3 additions & 2 deletions mysql-backup-s3/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/sh

set -e

Expand All @@ -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

0 comments on commit 588291b

Please sign in to comment.