mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 21:53:42 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e8ccf4d56 | ||
|
|
65c40cac0a |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
|||||||
|
## 4.0.13 2023-11-12 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Check for any quotes if using MONGO_CUSTOM_URI and remove
|
||||||
|
|
||||||
|
|
||||||
|
## 4.0.12 2023-11-12 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Allow creating schedulers if _MONGO_CUSTOM_URI is set and _DB_HOST blank
|
||||||
|
|
||||||
|
|
||||||
## 4.0.11 2023-11-11 <dave at tiredofit dot ca>
|
## 4.0.11 2023-11-11 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -158,6 +158,11 @@ bootstrap_variables() {
|
|||||||
sed -i "s|_PASS='\(.*\)'|_PASS=\1|g" "${backup_instance_vars}"
|
sed -i "s|_PASS='\(.*\)'|_PASS=\1|g" "${backup_instance_vars}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if grep -qo "MONGO_CUSTOM_URI='.*'" "${backup_instance_vars}"; then
|
||||||
|
print_debug "[bootstrap_variables] [backup_init] Found _MONGO_CUSTOM_URI variable with quotes"
|
||||||
|
sed -i "s|MONGO_CUSTOM_URI='\(.*\)'|MONGO_CUSTOM_URI=\1|g" "${backup_instance_vars}"
|
||||||
|
fi
|
||||||
|
|
||||||
transform_backup_instance_variable() {
|
transform_backup_instance_variable() {
|
||||||
if grep -q "^DB${1}_${2}=" "${backup_instance_vars}" && [ "$(grep "^DB${1}_${2}=" "${backup_instance_vars}" | cut -d = -f2)" != "unset" ]; then
|
if grep -q "^DB${1}_${2}=" "${backup_instance_vars}" && [ "$(grep "^DB${1}_${2}=" "${backup_instance_vars}" | cut -d = -f2)" != "unset" ]; then
|
||||||
export "$3"="$(grep "^DB${1}_${2}=" "${backup_instance_vars}" | cut -d = -f2-)"
|
export "$3"="$(grep "^DB${1}_${2}=" "${backup_instance_vars}" | cut -d = -f2-)"
|
||||||
@@ -1141,10 +1146,11 @@ create_archive() {
|
|||||||
|
|
||||||
create_schedulers() {
|
create_schedulers() {
|
||||||
if var_true "${DEBUG_CREATE_SCHEDULERS}" ; then debug on; fi
|
if var_true "${DEBUG_CREATE_SCHEDULERS}" ; then debug on; fi
|
||||||
|
|
||||||
backup() {
|
backup() {
|
||||||
bootstrap_variables upgrade BACKUP
|
local backup_instances=$(set -o posix ; set | grep -Pc "^(DB[0-9]._HOST=|.*MONGO_CUSTOM_URI=)")
|
||||||
local backup_instances=$(printenv | sort | grep -c "^DB[0-9]._HOST")
|
|
||||||
print_debug "[create_schedulers] Found '${backup_instances}' DB_HOST instances"
|
print_debug "[create_schedulers] Found '${backup_instances}' DB_HOST instances"
|
||||||
|
|
||||||
if [ -n "${DB_HOST}" ] && [ "${backup_instances}" ]; then
|
if [ -n "${DB_HOST}" ] && [ "${backup_instances}" ]; then
|
||||||
backup_instances=1;
|
backup_instances=1;
|
||||||
print_debug "[create_schedulers] Detected using old DB_ variables"
|
print_debug "[create_schedulers] Detected using old DB_ variables"
|
||||||
|
|||||||
Reference in New Issue
Block a user