mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 05:33:53 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7729743ccf | ||
|
|
d56efc0ee9 | ||
|
|
7d87e474e0 | ||
|
|
342c252d9a | ||
|
|
25f3cab21f | ||
|
|
e63d56c753 | ||
|
|
86722a8e8a | ||
|
|
4d6419fd18 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
|||||||
|
## 2.9.7 2021-12-15 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fixup for Zabbix Autoagent registration
|
||||||
|
|
||||||
|
|
||||||
|
## 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>
|
## 2.9.5 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
source /assets/functions/00-container
|
source /assets/functions/00-container
|
||||||
prepare_service single
|
prepare_service single
|
||||||
PROCESS_NAME="monitoring"
|
prepare_service 03-monitoring
|
||||||
|
PROCESS_NAME="db-backup"
|
||||||
output_off
|
output_off
|
||||||
|
|
||||||
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
|
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
|
cat <<EOF > "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_dbbackup.conf
|
||||||
# Zabbix DB Backup Configuration - Automatically Generated
|
# Zabbix DB Backup Configuration - Automatically Generated
|
||||||
# Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-dbbackup
|
# Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-dbbackup
|
||||||
|
|||||||
@@ -420,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}"
|
||||||
@@ -438,9 +441,10 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
today=$(date +"%Y%m%d")
|
today=$(date +"%Y%m%d")
|
||||||
|
|
||||||
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
|
||||||
target_time=$(($target_time + 24*60*60))
|
target_time=$(($target_time + 24*60*60))
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user