From a9480a92b6ab32e907210ea98815b0c2ab6d97ef Mon Sep 17 00:00:00 2001 From: Christoph Dyllick-Brenzinger Date: Tue, 17 Dec 2024 00:19:49 +0100 Subject: [PATCH] v1.5.0 add gzip compression --- CHANGELOG.md | 4 ++++ Dockerfile | 1 + README.md | 3 ++- pre-default.sh | 10 +++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e5ec9b..1a7a4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.5.0 (17.12.2024) + +- Add option to compress database dumps with gzip + ## 1.4.2 (06.12.2024) - Changes to improve Docker Scout Health Score diff --git a/Dockerfile b/Dockerfile index fda89e6..02a59fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,7 @@ RUN \ fuse \ cron \ ca-certificates \ + gzip \ jq \ && apt-get clean diff --git a/README.md b/README.md index 3091e54..425508b 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,8 @@ The container is set up by setting environment variables and volumes. | `DATABASE_USER` | User for connection to database | `root` | `root` | | `DATABASE_PASSWORD` | Password for connection to database | `topsecret` | | | `DATABASE_LIST` | List of databases to export (empyt=all) | `dtable_db,ccnet_db,seafile_db` | | -| `SEATABLE_BIGDATA_DUMP` | Enable dump of big data | `true`or`false` | `false` | +| `COMPRESS_DUMP` | Encrypt database dump with gzip | `true` or `false` | `false` | +| `SEATABLE_BIGDATA_DUMP` | Enable dump of big data | `true` or `false` | `false` | | `SEATABLE_BIGDATA_HOST` | Name of the SeaTable Server container | `seatable-server` | `seatable-server` | | `HEALTHCHECK_URL` | healthcheck.io server check url | `https://healthcheck.io/ping/a444061a` | | | `MSMTP_ARGS` | SMTP settings for mail notification | `--host=x --port=587 ... cdb@seatable.io` | | diff --git a/pre-default.sh b/pre-default.sh index c53a533..0b6772d 100755 --- a/pre-default.sh +++ b/pre-default.sh @@ -22,7 +22,7 @@ if [ "${DATABASE_DUMP}" == true ] || [ "${SEATABLE_DATABASE_DUMP}" == true ]; th elif command_exists mysqldump; then DUMP_COMMAND="mysqldump" else - log "Error" "Neither mariadb-dump nor mysqldump is available in the container." + log "ERROR" "Neither mariadb-dump nor mysqldump is available in the container." exit 1 fi @@ -39,6 +39,14 @@ if [ "${DATABASE_DUMP}" == true ] || [ "${SEATABLE_DATABASE_DUMP}" == true ]; th log "DEBUG" "Let's dump all databases" /usr/local/bin/docker exec ${DATABASE_HOST} ${DUMP_COMMAND} -u${DATABASE_USER} -p${DATABASE_PASSWORD} --all-databases > /data/database-dumps/all.dump fi + + # compress the dump files + if [ "${COMPRESS_DUMP}" == true ]; then + log "INFO" "Compressing dump files" + find /data/database-dumps -name "*.dump" -type f -exec gzip {} + + log "DEBUG" "Compression complete" + fi + log "INFO" "Dump finished" else log "DEBUG" "Skip database dump"