Skip to content

Commit 955a08a

Browse files
committed
Release 1.23.0 - See CHANGELOG.md
1 parent bf97c3a commit 955a08a

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.23.0 2020-06-15 <dave at tiredofit dot ca>
2+
3+
### Added
4+
- Add zstd compression support
5+
- Add choice of compression level
6+
7+
18
## 1.22.0 2020-06-10 <dave at tiredofit dot ca>
29

310
### Added

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)"
44
### Set Environment Variables
55
ENV ENABLE_CRON=FALSE \
66
ENABLE_SMTP=FALSE \
7-
ENABLE_ZABBIX=FALSE \
7+
ENABLE_ZABBIX=TRUE \
88
ZABBIX_HOSTNAME=db-backup
99

1010
### Dependencies
@@ -30,12 +30,13 @@ RUN set -ex && \
3030
postgresql-client \
3131
redis \
3232
xz \
33+
zstd \
3334
&& \
3435
\
3536
apk add \
3637
pixz@testing \
3738
&& \
38-
\
39+
\
3940
mkdir -p /usr/src/pbzip2 && \
4041
curl -ssL https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz | tar xvfz - --strip=1 -C /usr/src/pbzip2 && \
4142
cd /usr/src/pbzip2 && \

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Currently backs up CouchDB, InfluxDB, MySQL, MongoDB, Postgres, Redis, Rethink s
1717
* backup all databases
1818
* choose to have an MD5 sum after backup for verification
1919
* delete old backups after specific amount of time
20-
* choose compression type (none, gz, bz, xz)
20+
* choose compression type (none, gz, bz, xz, zstd)
2121
* connect to any container running on the same system
2222
* select how often to run a dump
2323
* select when to start the first dump, whether time of day or relative to container start time
@@ -83,13 +83,16 @@ The following directories are used for configuration and can be mapped for persi
8383

8484
## Environment Variables
8585

86+
*If you are trying to backup a database that doesn't have a user or a password (you should!) make sure you set `CONTAINER_ENABLE_DOCKER_SECRETS=FALSE`*
87+
8688
Along with the Environment Variables from the [Base image](https://hub.docker.com/r/tiredofit/alpine), below is the complete list of available options that can be used to customize your installation.
8789

8890

8991
| Parameter | Description |
9092
|-----------|-------------|
9193
| `BACKUP_LOCATION` | Backup to `FILESYSTEM` or `S3` compatible services like S3, Minio, Wasabi - Default `FILESYSTEM`
92-
| `COMPRESSION` | Use either Gzip `GZ`, Bzip2 `BZ`, XZip `XZ`, or none `NONE` - Default `GZ`
94+
| `COMPRESSION` | Use either Gzip `GZ`, Bzip2 `BZ`, XZip `XZ`, ZSTD `ZSTD` or none `NONE` - Default `GZ`
95+
| `COMPRESSION_LEVEL` | Numberical value of what level of compression to use, most allow `1` to `9` except for `ZSTD` which allows for `1` to `19` - Default `3` |
9396
| `DB_TYPE` | Type of DB Server to backup `couch` `influx` `mysql` `pgsql` `mongo` `redis` `rethink`
9497
| `DB_HOST` | Server Hostname e.g. `mariadb`
9598
| `DB_NAME` | Schema Name e.g. `database`
@@ -107,6 +110,7 @@ Along with the Environment Variables from the [Base image](https://hub.docker.co
107110
| `PARALLEL_COMPRESSION` | Use multiple cores when compressing backups `TRUE` or `FALSE` - Default `TRUE` |
108111
| `SPLIT_DB` | If using root as username and multiple DBs on system, set to TRUE to create Seperate DB Backups instead of all in one. - Default `FALSE` |
109112

113+
110114
**Backing Up to S3 Compatible Services**
111115

112116
If `BACKUP_LOCATION` = `S3` then the following options are used.

install/etc/services.available/10-db-backup/run

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ fi
1313
### Sanity Test
1414
sanity_var DB_TYPE "Database Type"
1515
sanity_var DB_HOST "Database Host"
16+
1617
file_env 'DB_USER'
1718
file_env 'DB_PASS'
1819

1920
### Set Defaults
2021
BACKUP_LOCATION=${BACKUP_LOCATION:-"FILESYSTEM"}
2122
COMPRESSION=${COMPRESSION:-GZ}
23+
COMPRESSION_LEVEL=${COMPRESSION_LEVEL:-"3"}
2224
DB_DUMP_BEGIN=${DB_DUMP_BEGIN:-+0}
2325
DB_DUMP_FREQ=${DB_DUMP_FREQ:-1440}
2426
DB_DUMP_TARGET=${DB_DUMP_TARGET:-/backup}
@@ -43,7 +45,6 @@ if [ "BACKUP_TYPE" = "S3" ] || [ "BACKUP_TYPE" = "s3" ] || [ "BACKUP_TYPE" = "MI
4345
sanity_var S3_PATH "S3 Path"
4446
file_env 'S3_KEY_ID'
4547
file_env 'S3_KEY_SECRET'
46-
4748
fi
4849

4950
if [ "$1" = "NOW" ]; then
@@ -53,13 +54,15 @@ fi
5354

5455
### Set Compression Options
5556
if var_true $PARALLEL_COMPRESSION ; then
56-
BZIP="pbzip2"
57-
GZIP="pigz"
58-
XZIP="pixz"
57+
BZIP="pbzip2 -${COMPRESSION_LEVEL}"
58+
GZIP="pigz -${COMPRESSION_LEVEL}"
59+
XZIP="pixz -${COMPRESSION_LEVEL}"
60+
ZSTD="zstd --rm -${COMPRESSION_LEVEL}"
5961
else
60-
BZIP="bzip2"
61-
GZIP="gzip"
62-
XZIP="xz"
62+
BZIP="bzip2 -${COMPRESSION_LEVEL}"
63+
GZIP="gzip -${COMPRESSION_LEVEL}"
64+
XZIP="xz -${COMPRESSION_LEVEL} "
65+
ZSTD="zstd --rm -${COMPRESSION_LEVEL}"
6366
fi
6467

6568

@@ -288,6 +291,10 @@ function compression() {
288291
$XZIP ${TMPDIR}/${TARGET}
289292
TARGET=${TARGET}.xz
290293
;;
294+
"ZSTD" | "zstd" | "ZST" | "zst" )
295+
$ZSTD ${TMPDIR}/${TARGET}
296+
TARGET=${TARGET}.zst
297+
;;
291298
"NONE" | "none" | "FALSE" | "false")
292299
;;
293300
esac

0 commit comments

Comments
 (0)