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 | |
|---|---|---|---|
|
|
ba20386e65 | ||
|
|
12211d3b67 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
## 3.3.6 2022-06-23 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for restore script when using all 7 arguments
|
||||||
|
|
||||||
|
|
||||||
|
## 3.3.5 2022-06-08 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix DB Port parameter not being able to be input in restore script
|
||||||
|
- Fix MongoDB restore questionnaire
|
||||||
|
|
||||||
|
|
||||||
## 3.3.4 2022-06-03 <rozdzynski@github>
|
## 3.3.4 2022-06-03 <rozdzynski@github>
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ The image will also allow you to use environment variables or Docker secrets use
|
|||||||
|
|
||||||
The script can also be executed skipping the interactive mode by using the following syntax/
|
The script can also be executed skipping the interactive mode by using the following syntax/
|
||||||
|
|
||||||
$(basename $0) <filename> <db_type> <db_hostname> <db_name> <db_user> <db_pass> <db_port>
|
$(basename "$0") <filename> <db_type> <db_hostname> <db_name> <db_user> <db_pass> <db_port>
|
||||||
|
|
||||||
If you only enter some of the arguments you will be prompted to fill them in.
|
If you only enter some of the arguments you will be prompted to fill them in.
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ EOF
|
|||||||
interactive_mode=true
|
interactive_mode=true
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
interactive_mode=false
|
interactive_mode=false
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -78,7 +78,7 @@ fi
|
|||||||
get_filename() {
|
get_filename() {
|
||||||
COLUMNS=12
|
COLUMNS=12
|
||||||
prompt="Please select a file to restore:"
|
prompt="Please select a file to restore:"
|
||||||
options=( $(find ${DB_DUMP_TARGET} -type f -maxdepth 1 -not -name '*.md5' -not -name '*.sha1' -print0 | xargs -0) )
|
options=( $(find "${DB_DUMP_TARGET}" -type f -maxdepth 1 -not -name '*.md5' -not -name '*.sha1' -print0 | xargs -0) )
|
||||||
PS3="$prompt "
|
PS3="$prompt "
|
||||||
select opt in "${options[@]}" "Custom" "Quit" ; do
|
select opt in "${options[@]}" "Custom" "Quit" ; do
|
||||||
if (( REPLY == 2 + ${#options[@]} )) ; then
|
if (( REPLY == 2 + ${#options[@]} )) ; then
|
||||||
@@ -641,7 +641,7 @@ EOF
|
|||||||
2 )
|
2 )
|
||||||
while true; do
|
while true; do
|
||||||
read -p "$(echo -e ${clg}** ${cdgy}Enter Value \(${cwh}C${cdgy}\) \| \(${cwh}E${cdgy}\) : ${cwh}${coff}) " q_dbport_menu
|
read -p "$(echo -e ${clg}** ${cdgy}Enter Value \(${cwh}C${cdgy}\) \| \(${cwh}E${cdgy}\) : ${cwh}${coff}) " q_dbport_menu
|
||||||
case "${q_dbname_menu,,}" in
|
case "${q_port_menu,,}" in
|
||||||
c* )
|
c* )
|
||||||
counter=1
|
counter=1
|
||||||
q_dbport=" "
|
q_dbport=" "
|
||||||
@@ -852,11 +852,11 @@ fi
|
|||||||
print_debug "Database Host '${r_dbhost}'"
|
print_debug "Database Host '${r_dbhost}'"
|
||||||
|
|
||||||
## Question Database Name
|
## Question Database Name
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${4}" ]; then
|
||||||
if [ ! -f "${3}" ]; then
|
if [ ! -f "${4}" ]; then
|
||||||
get_dbname
|
get_dbname
|
||||||
else
|
else
|
||||||
r_dbname="${3}"
|
r_dbname="${4}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
get_dbname
|
get_dbname
|
||||||
@@ -864,11 +864,11 @@ fi
|
|||||||
print_debug "Database Name '${r_dbname}'"
|
print_debug "Database Name '${r_dbname}'"
|
||||||
|
|
||||||
## Question Database User
|
## Question Database User
|
||||||
if [ -n "${4}" ]; then
|
if [ -n "${5}" ]; then
|
||||||
if [ ! -f "${4}" ]; then
|
if [ ! -f "${5}" ]; then
|
||||||
get_dbuser
|
get_dbuser
|
||||||
else
|
else
|
||||||
r_dbuser="${4}"
|
r_dbuser="${5}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
get_dbuser
|
get_dbuser
|
||||||
@@ -876,11 +876,11 @@ fi
|
|||||||
print_debug "Database User '${r_dbuser}'"
|
print_debug "Database User '${r_dbuser}'"
|
||||||
|
|
||||||
## Question Database Password
|
## Question Database Password
|
||||||
if [ -n "${5}" ]; then
|
if [ -n "${6}" ]; then
|
||||||
if [ ! -f "${5}" ]; then
|
if [ ! -f "${6}" ]; then
|
||||||
get_dbpass
|
get_dbpass
|
||||||
else
|
else
|
||||||
r_dbpass="${5}"
|
r_dbpass="${6}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
get_dbpass
|
get_dbpass
|
||||||
@@ -888,11 +888,11 @@ fi
|
|||||||
print_debug "Database Pass '${r_dbpass}'"
|
print_debug "Database Pass '${r_dbpass}'"
|
||||||
|
|
||||||
## Question Database Port
|
## Question Database Port
|
||||||
if [ -n "${6}" ]; then
|
if [ -n "${7}" ]; then
|
||||||
if [ ! -f "${6}" ]; then
|
if [ ! -f "${7}" ]; then
|
||||||
get_dbport
|
get_dbport
|
||||||
else
|
else
|
||||||
r_dbport="${6}"
|
r_dbport="${7}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
get_dbport
|
get_dbport
|
||||||
@@ -944,12 +944,12 @@ case "${r_dbtype}" in
|
|||||||
mongo_compression="--gzip"
|
mongo_compression="--gzip"
|
||||||
fi
|
fi
|
||||||
if [ -n "${r_dbuser}" ] ; then
|
if [ -n "${r_dbuser}" ] ; then
|
||||||
mongo_user="-u ${r_dbuser}"
|
mongo_user="-u=${r_dbuser}"
|
||||||
fi
|
fi
|
||||||
if [ -n "${r_dbpass}" ] ; then
|
if [ -n "${r_dbpass}" ] ; then
|
||||||
mongo_pass="-u ${r_dbpass}"
|
mongo_pass="-p=${r_dbpass}"
|
||||||
fi
|
fi
|
||||||
mongorestore ${mongo_compression} -d ${r_dbname} -h ${r_dbhost} --port ${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename}
|
mongorestore ${mongo_compression} -d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename}
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
|
|||||||
Reference in New Issue
Block a user