mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 21:53:42 +01:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
238b4d852c | ||
|
|
8d6e72eead | ||
|
|
a9037f97ac | ||
|
|
ebcd4fcde4 | ||
|
|
adf52c1160 | ||
|
|
1eee4a49d7 | ||
|
|
e3faab5c36 | ||
|
|
768d5e60fe | ||
|
|
e3e0d7ed67 | ||
|
|
db808d25c7 | ||
|
|
cb5b49b90b |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,3 +1,22 @@
|
|||||||
|
## 3.10.4 2023-10-11 <thomas-negrault@github>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Use authentication database for MongoDB restores
|
||||||
|
|
||||||
|
|
||||||
|
## 3.10.3 2023-10-11 <thomas-negrault@github>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Change sorting for restore script
|
||||||
|
|
||||||
|
|
||||||
|
## 3.10.2 2023-09-14 <pimjansen@github>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Update to wording when sending files to blobxfer
|
||||||
|
- Remove --databases flag when backing up a single mysql/mariadb backup which allows to omit the "USE <db_name>" statement in the backup allowing for better restores
|
||||||
|
|
||||||
|
|
||||||
## 3.10.1 2023-09-13 <dave at tiredofit dot ca>
|
## 3.10.1 2023-09-13 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ backup_mysql() {
|
|||||||
compression
|
compression
|
||||||
pre_dbbackup $db
|
pre_dbbackup $db
|
||||||
print_notice "Dumping MySQL/MariaDB database: '${db}' ${compression_string}"
|
print_notice "Dumping MySQL/MariaDB database: '${db}' ${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} ${EXTRA_DUMP_OPTS} --databases $db | $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} ${EXTRA_DUMP_OPTS} $db | $compress_cmd > "${TEMP_LOCATION}"/"${target}"
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
check_exit_code backup $target
|
check_exit_code backup $target
|
||||||
generate_checksum
|
generate_checksum
|
||||||
@@ -748,7 +748,7 @@ move_dbbackup() {
|
|||||||
rm -rf "${TEMP_LOCATION}"/"${target}"
|
rm -rf "${TEMP_LOCATION}"/"${target}"
|
||||||
;;
|
;;
|
||||||
"blobxfer" )
|
"blobxfer" )
|
||||||
print_info "Moving backup to S3 Bucket with blobxfer"
|
print_info "Moving backup to external storage with blobxfer"
|
||||||
|
|
||||||
mkdir -p "${DB_DUMP_TARGET}"
|
mkdir -p "${DB_DUMP_TARGET}"
|
||||||
if var_true "${ENABLE_CHECKSUM}" ; then mv "${TEMP_LOCATION}"/*."${checksum_extension}" "${DB_DUMP_TARGET}"/; fi
|
if var_true "${ENABLE_CHECKSUM}" ; then mv "${TEMP_LOCATION}"/*."${checksum_extension}" "${DB_DUMP_TARGET}"/; 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 | sort -z | 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
|
||||||
@@ -925,7 +925,10 @@ case "${r_dbtype}" in
|
|||||||
if [ -n "${r_dbpass}" ] ; then
|
if [ -n "${r_dbpass}" ] ; then
|
||||||
mongo_pass="-p=${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}
|
if [ -n "${DB_AUTH}" ] ; then
|
||||||
|
mongo_auth_database="--authenticationDatabase=${DB_AUTH}"
|
||||||
|
fi
|
||||||
|
mongorestore ${mongo_compression} -d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename} ${mongo_auth_database}
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
|
|||||||
Reference in New Issue
Block a user