Skip to content

Commit 03d2362

Browse files
authored
Merge branch 'tiredofit:main' into main
2 parents 5f58ce8 + e3faab5 commit 03d2362

File tree

7 files changed

+180
-69
lines changed

7 files changed

+180
-69
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ jobs:
1010
build:
1111
uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
1212
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
13-
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
1413
#uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
1514
secrets: inherit

.github/workflows/manual.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ jobs:
1111
build:
1212
uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
1313
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
14-
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
1514
#uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
1615
secrets: inherit

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,76 @@
1+
## 3.10.2 2023-09-14 <pimjansen@github>
2+
3+
### Changed
4+
- Update to wording when sending files to blobxfer
5+
- Remove --databases flag when backing up a single mysql/mariadb backup which allows to omit the "USE <db_name>" statement in the backup allowing for better restores
6+
7+
8+
## 3.10.1 2023-09-13 <dave at tiredofit dot ca>
9+
10+
### Changed
11+
- Bugfix to 3.10.0 with syntax error revolving around unbraced variable
12+
13+
14+
## 3.10.0 2023-09-13 <jcdirks@github>
15+
16+
### Added
17+
- Add EXTRA_DUMP_OPTS and EXTRA_ENUMERATION_OPTS to add different arguments when checking for databases, vs doing the actual backup
18+
19+
20+
## 3.9.12 2023-09-04 <dave at tiredofit dot ca>
21+
22+
### Changed
23+
- Perform additional checks for ENABLE_CHECKSUM=FALSE and skip executing actions for S3/BlobXfer
24+
25+
26+
## 3.9.11 2023-08-24 <dave at tiredofit dot ca>
27+
28+
### Changed
29+
- AWS CLI 2.13.9
30+
31+
32+
## 3.9.10 2023-08-23 <dave at tiredofit dot ca>
33+
34+
### Changed
35+
- Stop trying to move a non existent checksum file when ENABLE_CHECKSUM=FALSE
36+
37+
38+
## 3.9.9 2023-08-21 <dave at tiredofit dot ca>
39+
40+
### Changed
41+
- Start compiling aws-cli instead of from packages to continue to support arm/v7
42+
43+
44+
## 3.9.8 2023-08-20 <ToshY@github>
45+
46+
### Changed
47+
- Restore armv7 and aarch64 builds
48+
49+
50+
## 3.9.7 2023-07-18 <dave at tiredofit dot ca>
51+
52+
### Changed
53+
- Cleanup check_exit_code parameter and reduce duplicate output
54+
55+
56+
## 3.9.6 2023-06-16 <dave at tiredofit dot ca>
57+
58+
### Changed
59+
- Resolve issues introduced with 3.9.3. Split exit codes to be specific for backing up and moving. Uses paremter $11 for post backup scripts
60+
61+
62+
## 3.9.5 2023-06-13 <dave at tiredofit dot ca>
63+
64+
### Changed
65+
- Start building Influx DB v1 manually due to being removed from Alpine repositories
66+
67+
68+
## 3.9.4 2023-06-13 <dave at tiredofit dot ca>
69+
70+
### Added
71+
- Add abliity to use --rsyncable argument to zstd archives
72+
73+
174
## 3.9.3 2023-06-05 <dave at tiredofit dot ca>
275

376
### Added

Dockerfile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ FROM docker.io/tiredofit/${DISTRO}:${DISTRO_VARIANT}
55
LABEL maintainer="Dave Conroy (github.com/tiredofit)"
66

77
### Set Environment Variables
8-
ENV INFLUX2_VERSION=2.4.0 \
8+
ENV INFLUX_VERSION=1.8.0 \
9+
INFLUX2_VERSION=2.4.0 \
910
MSSQL_VERSION=18.0.1.1-1 \
11+
AWS_CLI_VERSION=1.25.97 \
1012
CONTAINER_ENABLE_MESSAGING=FALSE \
1113
CONTAINER_ENABLE_MONITORING=TRUE \
1214
CONTAINER_PROCESS_RUNAWAY_PROTECTOR=FALSE \
@@ -21,7 +23,9 @@ RUN source /assets/functions/00-container && \
2123
package install .db-backup-build-deps \
2224
build-base \
2325
bzip2-dev \
26+
cargo \
2427
git \
28+
go \
2529
libarchive-dev \
2630
openssl-dev \
2731
libffi-dev \
@@ -31,9 +35,8 @@ RUN source /assets/functions/00-container && \
3135
&& \
3236
\
3337
package install .db-backup-run-deps \
34-
aws-cli \
3538
bzip2 \
36-
influxdb \
39+
groff \
3740
libarchive \
3841
mariadb-client \
3942
mariadb-connector-c \
@@ -43,7 +46,16 @@ RUN source /assets/functions/00-container && \
4346
postgresql15 \
4447
postgresql15-client \
4548
pv \
49+
py3-botocore \
50+
py3-colorama \
4651
py3-cryptography \
52+
py3-docutils \
53+
py3-jmespath \
54+
py3-rsa \
55+
py3-setuptools \
56+
py3-s3transfer \
57+
py3-yaml \
58+
python3 \
4759
redis \
4860
sqlite \
4961
xz \
@@ -60,7 +72,11 @@ RUN source /assets/functions/00-container && \
6072
\
6173
if [ $mssql = "true" ] ; then curl -O https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_${MSSQL_VERSION}_amd64.apk ; curl -O https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/mssql-tools18_${MSSQL_VERSION}_amd64.apk ; echo y | apk add --allow-untrusted msodbcsql18_${MSSQL_VERSION}_amd64.apk mssql-tools18_${MSSQL_VERSION}_amd64.apk ; else echo >&2 "Detected non x86_64 build variant, skipping MSSQL installation" ; fi; \
6274
if [ $influx2 = "true" ] ; then curl -sSL https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX2_VERSION}-linux-${influx_arch}.tar.gz | tar xvfz - --strip=1 -C /usr/src/ ; chmod +x /usr/src/influx ; mv /usr/src/influx /usr/sbin/ ; else echo >&2 "Unable to build Influx 2 on this system" ; fi ; \
63-
\
75+
clone_git_repo https://github.com/aws/aws-cli "${AWS_CLI_VERSION}" && \
76+
python3 setup.py install --prefix=/usr && \
77+
clone_git_repo https://github.com/influxdata/influxdb "${INFLUX_VERSION}" && \
78+
go build -o /usr/sbin/influxd ./cmd/influxd && \
79+
strip /usr/sbin/influxd && \
6480
mkdir -p /usr/src/pbzip2 && \
6581
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 && \
6682
cd /usr/src/pbzip2 && \
@@ -85,6 +101,7 @@ RUN source /assets/functions/00-container && \
85101
/*.apk \
86102
/etc/logrotate.d/* \
87103
/root/.cache \
104+
/root/go \
88105
/tmp/* \
89106
/usr/src/*
90107

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,17 @@ Your Organization will be mapped to `DB_USER` and your root token will need to b
179179

180180
### Backup Options
181181
| Parameter | Description | Default | `_FILE` |
182-
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------- |
182+
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------|---------------------------|---------|
183183
| `COMPRESSION` | Use either Gzip `GZ`, Bzip2 `BZ`, XZip `XZ`, ZSTD `ZSTD` or none `NONE` | `ZSTD` | |
184184
| `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` - | `3` | |
185185
| `ENABLE_PARALLEL_COMPRESSION` | Use multiple cores when compressing backups `TRUE` or `FALSE` | `TRUE` | |
186186
| `PARALLEL_COMPRESSION_THREADS` | Maximum amount of threads to use when compressing - Integer value e.g. `8` | `autodetected` | |
187187
| `GZ_RSYNCABLE` | Use `--rsyncable` (gzip only) for faster rsync transfers and incremental backup deduplication. e.g. `TRUE` | `FALSE` | |
188188
| `ENABLE_CHECKSUM` | Generate either a MD5 or SHA1 in Directory, `TRUE` or `FALSE` | `TRUE` | |
189189
| `CHECKSUM` | Either `MD5` or `SHA1` | `MD5` | |
190-
| `EXTRA_OPTS` | If you need to pass extra arguments to the backup command, add them here e.g. `--extra-command` | | |
190+
| `EXTRA_OPTS` | If you need to pass extra arguments to the backup and database enumeration command, add them here e.g. `--extra-command` | | |
191+
| `EXTRA_DUMP_OPTS` | If you need to pass extra arguments to the backup command only, add them here e.g. `--extra-command` | | |
192+
| `EXTRA_ENUMERATION_OPTS` | If you need to pass extra arguments to the database enumeration command only, add them here e.g. `--extra-command` | | |
191193
| `MYSQL_MAX_ALLOWED_PACKET` | Max allowed packet if backing up MySQL / MariaDB | `512M` | |
192194
| `MYSQL_SINGLE_TRANSACTION` | Backup in a single transaction with MySQL / MariaDB | `TRUE` | |
193195
| `MYSQL_STORED_PROCEDURES` | Backup stored procedures with MySQL / MariaDB | `TRUE` | |
@@ -323,17 +325,18 @@ $ cat post-script.sh
323325
# #### $8=BACKUP FILENAME (Filename)
324326
# #### $9=BACKUP FILESIZE
325327
# #### $10=HASH (If CHECKSUM enabled)
328+
# #### $11=MOVE_EXIT_CODE
326329

327330
echo "${1} ${2} Backup Completed on ${3} for ${4} on ${5} ending ${6} for a duration of ${7} seconds. Filename: ${8} Size: ${9} bytes MD5: ${10}"
328331
````
329332

330333
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
331-
${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_timme}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
334+
${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_timme}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" "${move_exit_code}
332335

333336

334337
Outputs the following on the console:
335338

336-
`0 mysql Backup Completed on example-db for example on 1647370800 ending 1647370920 for a duration of 120 seconds. Filename: mysql_example_example-db_202200315-000000.sql.bz2 Size: 7795 bytes Hash: 952fbaafa30437494fdf3989a662cd40`
339+
`0 mysql Backup Completed on example-db for example on 1647370800 ending 1647370920 for a duration of 120 seconds. Filename: mysql_example_example-db_202200315-000000.sql.bz2 Size: 7795 bytes Hash: 952fbaafa30437494fdf3989a662cd40 0`
337340

338341
If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes`
339342

examples/mysql/docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ services:
3131
- ./backups:/backup
3232
#- ./post-script.sh:/assets/custom-scripts/post-script.sh
3333
environment:
34+
- TIMEZONE=America/Vancouver
35+
- CONTAINER_ENABLE_MONITORING=FALSE
3436
# - DEBUG_MODE=TRUE
3537
- DB_TYPE=mariadb
3638
- DB_HOST=example-db-host
@@ -43,7 +45,7 @@ services:
4345
- CHECKSUM=SHA1
4446
- COMPRESSION=GZ
4547
- SPLIT_DB=FALSE
46-
- CONTAINER_ENABLE_MONITORING=FALSE
48+
4749
restart: always
4850
networks:
4951
- example-db-network

0 commit comments

Comments
 (0)