From b0ae6e075deea0d97dac15ed7a301ae87b626c91 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Thu, 19 Jan 2023 19:57:03 +0100 Subject: [PATCH 1/4] update to ubuntu 22.04 --- .github/workflows/image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 8d51bd3..6705901 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -10,14 +10,14 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout the code uses: actions/checkout@v3 - name: Test Bash scripts run: sudo apt-get -qq update && sudo apt-get install -y devscripts shellcheck && make test build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: test steps: - name: Checkout the code From 47977b7846b1c40c061a7bc218549557749aeb77 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Thu, 19 Jan 2023 19:57:20 +0100 Subject: [PATCH 2/4] ignore data dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6320cd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data \ No newline at end of file From 1f5f594e14501ab85c14b231afdba8d3a0cd85ca Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Thu, 19 Jan 2023 20:01:21 +0100 Subject: [PATCH 3/4] add parenthesis to function syntax --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 5ebe1b3..320047c 100755 --- a/run.sh +++ b/run.sh @@ -16,7 +16,7 @@ elif [ -n "${INIT_RESTORE_LATEST}" ]; then find /backup -maxdepth 1 -name '[0-9]*.*.sql.gz' | sort | tail -1 | xargs /restore.sh fi -function final_backup { +function final_backup () { echo "=> Captured trap for final backup" DATE=$(date +%Y%m%d%H%M) echo "=> Requested last backup at $(date "+%Y-%m-%d %H:%M:%S")" From d6217926f275b8b19a4b2f0f32b0319122e5b8d5 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Thu, 19 Jan 2023 20:14:48 +0100 Subject: [PATCH 4/4] fix minor issues --- Makefile | 2 +- backup.sh | 2 +- run.sh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index dc20422..ca5d51c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ test: # Checking for syntax errors set -e; for SCRIPT in *.sh; \ do \ - sh -n $$SCRIPT; \ + bash -n $$SCRIPT; \ done # Checking for bashisms (currently not failing, but only listing) diff --git a/backup.sh b/backup.sh index 678ec3d..747cd82 100755 --- a/backup.sh +++ b/backup.sh @@ -47,7 +47,7 @@ do if [ -n "$MAX_BACKUPS" ] then # Execute the delete script, delete older backup or other custom delete script - /delete.sh $db $EXT + /delete.sh "$db" $EXT fi else rm -rf "$FILENAME" diff --git a/run.sh b/run.sh index 320047c..5990e0a 100755 --- a/run.sh +++ b/run.sh @@ -16,9 +16,8 @@ elif [ -n "${INIT_RESTORE_LATEST}" ]; then find /backup -maxdepth 1 -name '[0-9]*.*.sql.gz' | sort | tail -1 | xargs /restore.sh fi -function final_backup () { +function final_backup { echo "=> Captured trap for final backup" - DATE=$(date +%Y%m%d%H%M) echo "=> Requested last backup at $(date "+%Y-%m-%d %H:%M:%S")" exec /backup.sh exit 0