mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 13:44:08 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d56efc0ee9 | ||
|
|
7d87e474e0 | ||
|
|
342c252d9a | ||
|
|
25f3cab21f | ||
|
|
e63d56c753 | ||
|
|
86722a8e8a | ||
|
|
4d6419fd18 | ||
|
|
99153ac6d1 | ||
|
|
142967135d | ||
|
|
1df66853fb |
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,3 +1,27 @@
|
|||||||
|
## 2.9.6 2021-12-03 <alexbarcello@githuba>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for S3 Minio backup targets
|
||||||
|
- Fix for annoying output on certain target time print conditions
|
||||||
|
|
||||||
|
## 2.9.5 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for 2.9.3
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.4 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add Zabbix auto register support for templates
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.3 2021-11-24 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Alpine 3.15 base
|
||||||
|
|
||||||
|
|
||||||
## 2.9.2 2021-10-22 <teenigma@github>
|
## 2.9.2 2021-10-22 <teenigma@github>
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/tiredofit/alpine:3.14
|
FROM docker.io/tiredofit/alpine:3.15
|
||||||
|
|
||||||
### Set Environment Variables
|
### Set Environment Variables
|
||||||
ENV MSSQL_VERSION=17.8.1.1-1 \
|
ENV MSSQL_VERSION=17.8.1.1-1 \
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ If `BACKUP_LOCATION` = `S3` then the following options are used.
|
|||||||
| `S3_KEY_SECRET` | S3 Key Secret |
|
| `S3_KEY_SECRET` | S3 Key Secret |
|
||||||
| `S3_PATH` | S3 Pathname to save to e.g. '`backup`' |
|
| `S3_PATH` | S3 Pathname to save to e.g. '`backup`' |
|
||||||
| `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` |
|
| `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` |
|
||||||
| `S3_URI_STYLE` | Choose either `VIRTUALHOST` or `PATH` style - Default `VIRTUALHOST` |
|
|
||||||
|
|
||||||
|
|
||||||
## Maintenance
|
## Maintenance
|
||||||
|
|||||||
17
install/etc/cont-init.d/10-db-backup
Executable file
17
install/etc/cont-init.d/10-db-backup
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
source /assets/functions/00-container
|
||||||
|
prepare_service single
|
||||||
|
PROCESS_NAME="monitoring"
|
||||||
|
output_off
|
||||||
|
|
||||||
|
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
|
||||||
|
source /assets/defaults/03-monitoring
|
||||||
|
cat <<EOF > "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_dbbackup.conf
|
||||||
|
# Zabbix DB Backup Configuration - Automatically Generated
|
||||||
|
# Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-dbbackup
|
||||||
|
# Autoregister=dbbackup
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
liftoff
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
source /assets/functions/00-container
|
source /assets/functions/00-container
|
||||||
|
|
||||||
PROCESS_NAME="db-backup"
|
PROCESS_NAME="db-backup"
|
||||||
|
|
||||||
date >/dev/null
|
date >/dev/null
|
||||||
@@ -421,7 +420,10 @@ move_backup() {
|
|||||||
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
||||||
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
||||||
export AWS_DEFAULT_REGION=ap-northeast-2
|
export AWS_DEFAULT_REGION=ap-northeast-2
|
||||||
aws s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
|
||||||
|
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
||||||
|
|
||||||
|
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
||||||
|
|
||||||
rm -rf ${tmpdir}/*.md5
|
rm -rf ${tmpdir}/*.md5
|
||||||
rm -rf ${tmpdir}/"${target}"
|
rm -rf ${tmpdir}/"${target}"
|
||||||
@@ -440,6 +442,7 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
|
|
||||||
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
||||||
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
||||||
|
target_time=$(($current_time + $waittime))
|
||||||
else
|
else
|
||||||
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
||||||
if [[ "$target_time" < "$current_time" ]]; then
|
if [[ "$target_time" < "$current_time" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user