mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 05:33:53 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36506091be | ||
|
|
bf646381cb | ||
|
|
fb3b65b33a | ||
|
|
6d1ef87042 | ||
|
|
c985cc8a4f | ||
|
|
2265a6acf5 | ||
|
|
10e7debc65 |
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@@ -8,8 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
|
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
#uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
|
||||||
uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|||||||
5
.github/workflows/manual.yml
vendored
5
.github/workflows/manual.yml
vendored
@@ -9,8 +9,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
|
#uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
|
||||||
#uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
|
#uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
|
||||||
uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|||||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
|||||||
|
## 3.9.11 2023-08-24 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- AWS CLI 2.13.9
|
||||||
|
|
||||||
|
|
||||||
|
## 3.9.10 2023-08-23 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Stop trying to move a non existent checksum file when ENABLE_CHECKSUM=FALSE
|
||||||
|
|
||||||
|
|
||||||
|
## 3.9.9 2023-08-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Start compiling aws-cli instead of from packages to continue to support arm/v7
|
||||||
|
|
||||||
|
|
||||||
|
## 3.9.8 2023-08-20 <ToshY@github>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Restore armv7 and aarch64 builds
|
||||||
|
|
||||||
|
|
||||||
|
## 3.9.7 2023-07-18 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Cleanup check_exit_code parameter and reduce duplicate output
|
||||||
|
|
||||||
|
|
||||||
## 3.9.6 2023-06-16 <dave at tiredofit dot ca>
|
## 3.9.6 2023-06-16 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
15
Dockerfile
15
Dockerfile
@@ -8,6 +8,7 @@ LABEL maintainer="Dave Conroy (github.com/tiredofit)"
|
|||||||
ENV INFLUX_VERSION=1.8.0 \
|
ENV INFLUX_VERSION=1.8.0 \
|
||||||
INFLUX2_VERSION=2.4.0 \
|
INFLUX2_VERSION=2.4.0 \
|
||||||
MSSQL_VERSION=18.0.1.1-1 \
|
MSSQL_VERSION=18.0.1.1-1 \
|
||||||
|
AWS_CLI_VERSION=1.25.97 \
|
||||||
CONTAINER_ENABLE_MESSAGING=FALSE \
|
CONTAINER_ENABLE_MESSAGING=FALSE \
|
||||||
CONTAINER_ENABLE_MONITORING=TRUE \
|
CONTAINER_ENABLE_MONITORING=TRUE \
|
||||||
CONTAINER_PROCESS_RUNAWAY_PROTECTOR=FALSE \
|
CONTAINER_PROCESS_RUNAWAY_PROTECTOR=FALSE \
|
||||||
@@ -22,6 +23,7 @@ RUN source /assets/functions/00-container && \
|
|||||||
package install .db-backup-build-deps \
|
package install .db-backup-build-deps \
|
||||||
build-base \
|
build-base \
|
||||||
bzip2-dev \
|
bzip2-dev \
|
||||||
|
cargo \
|
||||||
git \
|
git \
|
||||||
go \
|
go \
|
||||||
libarchive-dev \
|
libarchive-dev \
|
||||||
@@ -33,8 +35,8 @@ RUN source /assets/functions/00-container && \
|
|||||||
&& \
|
&& \
|
||||||
\
|
\
|
||||||
package install .db-backup-run-deps \
|
package install .db-backup-run-deps \
|
||||||
aws-cli \
|
|
||||||
bzip2 \
|
bzip2 \
|
||||||
|
groff \
|
||||||
libarchive \
|
libarchive \
|
||||||
mariadb-client \
|
mariadb-client \
|
||||||
mariadb-connector-c \
|
mariadb-connector-c \
|
||||||
@@ -44,7 +46,16 @@ RUN source /assets/functions/00-container && \
|
|||||||
postgresql15 \
|
postgresql15 \
|
||||||
postgresql15-client \
|
postgresql15-client \
|
||||||
pv \
|
pv \
|
||||||
|
py3-botocore \
|
||||||
|
py3-colorama \
|
||||||
py3-cryptography \
|
py3-cryptography \
|
||||||
|
py3-docutils \
|
||||||
|
py3-jmespath \
|
||||||
|
py3-rsa \
|
||||||
|
py3-setuptools \
|
||||||
|
py3-s3transfer \
|
||||||
|
py3-yaml \
|
||||||
|
python3 \
|
||||||
redis \
|
redis \
|
||||||
sqlite \
|
sqlite \
|
||||||
xz \
|
xz \
|
||||||
@@ -61,6 +72,8 @@ RUN source /assets/functions/00-container && \
|
|||||||
\
|
\
|
||||||
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; \
|
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; \
|
||||||
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 ; \
|
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 ; \
|
||||||
|
clone_git_repo https://github.com/aws/aws-cli "${AWS_CLI_VERSION}" && \
|
||||||
|
python3 setup.py install --prefix=/usr && \
|
||||||
clone_git_repo https://github.com/influxdata/influxdb "${INFLUX_VERSION}" && \
|
clone_git_repo https://github.com/influxdata/influxdb "${INFLUX_VERSION}" && \
|
||||||
go build -o /usr/sbin/influxd ./cmd/influxd && \
|
go build -o /usr/sbin/influxd ./cmd/influxd && \
|
||||||
strip /usr/sbin/influxd && \
|
strip /usr/sbin/influxd && \
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ backup_mongo() {
|
|||||||
print_notice "Dumping MongoDB database: '${DB_NAME}' ${compression_string}"
|
print_notice "Dumping MongoDB database: '${DB_NAME}' ${compression_string}"
|
||||||
silent mongodump --archive=${TEMP_LOCATION}/${target} ${mongo_compression} ${mongo_backup_parameter}
|
silent mongodump --archive=${TEMP_LOCATION}/${target} ${mongo_compression} ${mongo_backup_parameter}
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
check_exit_code $target
|
check_exit_code backup $target
|
||||||
generate_checksum
|
generate_checksum
|
||||||
move_dbbackup
|
move_dbbackup
|
||||||
check_exit_code move $target
|
check_exit_code move $target
|
||||||
@@ -289,7 +289,7 @@ backup_mysql() {
|
|||||||
print_notice "Dumping all MySQL / MariaDB databases: '$(echo ${db_names} | xargs | tr ' ' ',')' ${compression_string}"
|
print_notice "Dumping all MySQL / MariaDB databases: '$(echo ${db_names} | xargs | tr ' ' ',')' ${compression_string}"
|
||||||
mysqldump --max-allowed-packet=${MYSQL_MAX_ALLOWED_PACKET} -h ${DB_HOST} -P ${DB_PORT} -u${DB_USER} ${single_transaction} ${stored_procedures} ${mysql_tls_args} ${EXTRA_OPTS} --databases $(echo ${db_names} | xargs) | $compress_cmd > "${TEMP_LOCATION}"/"${target}"
|
mysqldump --max-allowed-packet=${MYSQL_MAX_ALLOWED_PACKET} -h ${DB_HOST} -P ${DB_PORT} -u${DB_USER} ${single_transaction} ${stored_procedures} ${mysql_tls_args} ${EXTRA_OPTS} --databases $(echo ${db_names} | xargs) | $compress_cmd > "${TEMP_LOCATION}"/"${target}"
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
check_exit_code $target
|
check_exit_code backup $target
|
||||||
generate_checksum
|
generate_checksum
|
||||||
move_dbbackup
|
move_dbbackup
|
||||||
check_exit_code move $target
|
check_exit_code move $target
|
||||||
@@ -531,23 +531,12 @@ check_exit_code() {
|
|||||||
print_debug "Moving of backup '${2}' completed successfully"
|
print_debug "Moving of backup '${2}' completed successfully"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
print_error "Moving of backup '${1}' reported errors"
|
print_error "Moving of backup '${2}' reported errors"
|
||||||
master_exit_code=1
|
master_exit_code=1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
case "${exit_code}" in
|
|
||||||
0 )
|
|
||||||
print_info "DB Backup of '${1}' completed successfully"
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
print_error "DB Backup of '${1}' reported errors"
|
|
||||||
master_exit_code=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup_old_data() {
|
cleanup_old_data() {
|
||||||
@@ -718,7 +707,7 @@ move_dbbackup() {
|
|||||||
"file" | "filesystem" )
|
"file" | "filesystem" )
|
||||||
print_debug "Moving backup to filesystem"
|
print_debug "Moving backup to filesystem"
|
||||||
mkdir -p "${DB_DUMP_TARGET}"
|
mkdir -p "${DB_DUMP_TARGET}"
|
||||||
mv "${TEMP_LOCATION}"/*."${checksum_extension}" "${DB_DUMP_TARGET}"/
|
if var_true "${ENABLE_CHECKSUM}" ; then mv "${TEMP_LOCATION}"/*."${checksum_extension}" "${DB_DUMP_TARGET}"/ ; fi
|
||||||
mv "${TEMP_LOCATION}"/"${target}" "${DB_DUMP_TARGET}"/"${target}"
|
mv "${TEMP_LOCATION}"/"${target}" "${DB_DUMP_TARGET}"/"${target}"
|
||||||
move_exit_code=$?
|
move_exit_code=$?
|
||||||
if var_true "${CREATE_LATEST_SYMLINK}" ; then
|
if var_true "${CREATE_LATEST_SYMLINK}" ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user