Skip to content

Commit

Permalink
v1.5.0 add gzip compression
Browse files Browse the repository at this point in the history
  • Loading branch information
christophdb committed Dec 16, 2024
1 parent b6fd3b8 commit a9480a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN \
fuse \
cron \
ca-certificates \
gzip \
jq \
&& apt-get clean

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ... [email protected]` | |
Expand Down
10 changes: 9 additions & 1 deletion pre-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

0 comments on commit a9480a9

Please sign in to comment.