Compare commits

..

3 Commits
4.0.0 ... 4.0.1

Author SHA1 Message Date
dave@tiredofit.ca
55d2067b43 Release 4.0.1 - See CHANGELOG.md 2023-11-09 08:04:05 -08:00
Dave Conroy
0d56a26f0f restore - remove reference to DB_DUMP_TARGET and instead use DEFAULT_BACKUP_PATH 2023-11-09 08:03:39 -08:00
Dave Conroy
635411bdd5 Update README.md 2023-11-08 22:37:39 -08:00
3 changed files with 20 additions and 11 deletions

View File

@@ -1,3 +1,9 @@
## 4.0.1 2023-11-09 <dave at tiredofit dot ca>
### Changed
- Restore - Stop using DB_DUMP_TARGET and instead browse using DEFAULT_BACKUP_PATH
## 4.0.0 2023-11-08 <dave at tiredofit dot ca> ## 4.0.0 2023-11-08 <dave at tiredofit dot ca>
This is the fourth major release to the DB Backup image which started as a basic MySQL backup service in early 2017. With each major release brings enhancements, bugfixes, removals along with breaking changes and this one is no different. This is the fourth major release to the DB Backup image which started as a basic MySQL backup service in early 2017. With each major release brings enhancements, bugfixes, removals along with breaking changes and this one is no different.

View File

@@ -212,6 +212,8 @@ If these are set and no other defaults or variables are set explicitly, they wil
##### Encryption Options ##### Encryption Options
Encryption occurs after compression and the encrypted filename will have a `.gpg` suffix
| Variable | Description | Default | | Variable | Description | Default |
| ---------------------------- | ------------------------------------------- | ------- | | ---------------------------- | ------------------------------------------- | ------- |
| `DEFAULT_ENCRYPT` | Encrypt file after backing up with GPG | `FALSE` | | `DEFAULT_ENCRYPT` | Encrypt file after backing up with GPG | `FALSE` |
@@ -229,7 +231,7 @@ If these are set and no other defaults or variables are set explicitly, they wil
| | Absolute HHMM, e.g. `2330` or `0415` | | | | Absolute HHMM, e.g. `2330` or `0415` | |
| | Relative +MM, i.e. how many minutes after starting the container, e.g. `+0` (immediate), `+10` (in 10 minutes), or `+90` in an hour and a half | | | | Relative +MM, i.e. how many minutes after starting the container, e.g. `+0` (immediate), `+10` (in 10 minutes), or `+90` in an hour and a half | |
| | Full datestamp e.g. `2023-12-21 23:30:00` | | | | Full datestamp e.g. `2023-12-21 23:30:00` | |
| | Cron expression e.g. `30 23 * * *` - [Understand the format](https://en.wikipedia.org/wiki/ Cron) - *BACKUP_INTERVAL is ignored* | | | | Cron expression e.g. `30 23 * * *` [Understand the format](https://en.wikipedia.org/wiki/Cron) - *BACKUP_INTERVAL is ignored* | |
| `DEFAULT_CLEANUP_TIME` | Value in minutes to delete old backups (only fired when backup interval executes) | `FALSE` | | `DEFAULT_CLEANUP_TIME` | Value in minutes to delete old backups (only fired when backup interval executes) | `FALSE` |
| | 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything. | | | | 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything. | |
| `DEFAULT_ARCHIVE_TIME` | Value in minutes to move all files files older than (x) from | | | `DEFAULT_ARCHIVE_TIME` | Value in minutes to move all files files older than (x) from | |
@@ -390,11 +392,11 @@ echo "${1} Backup Starting on ${2} for ${3} at ${4}. Filename: ${5}"
``` ```
## script DBXX_TYPE DBXX_HOST DBXX_NAME STARTEPOCH BACKUP_FILENAME ## script DBXX_TYPE DBXX_HOST DBXX_NAME STARTEPOCH BACKUP_FILENAME
${f} "${backup_job_db_type}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${target}" ${f} "${backup_job_db_type}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${backup_job_file}"
Outputs the following on the console: Outputs the following on the console:
`mysql Backup Starting on example-db for example at 1647370800. Filename: mysql_example_example-db_202200315-000000.sql.bz2 `mysql Backup Starting on example-db for example at 1647370800. Filename: mysql_example_example-db_202200315-000000.sql.bz2`
###### Post backup ###### Post backup
@@ -421,7 +423,7 @@ echo "${1} ${2} Backup Completed on ${3} for ${4} on ${5} ending ${6} for a dura
``` ```
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE ## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
${f} "${exit_code}" "${dbtype}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${backup_routines_finish_time}" "${backup_routines_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" "${move_exit_code} ${f} "${exit_code}" "${dbtype}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${backup_routines_finish_time}" "${backup_routines_total_time}" "${backup_job_file}" "${filesize}" "${checksum_value}" "${move_exit_code}
Outputs the following on the console: Outputs the following on the console:
@@ -471,6 +473,8 @@ Otherwise, override them per backup job. Additional backup jobs can be scheduled
##### Encryption Options ##### Encryption Options
Encryption will occur after compression and the resulting filename will have a `.gpg` suffix
| Variable | Description | Default | | Variable | Description | Default |
| ------------------------- | ------------------------------------------- | ------- | | ------------------------- | ------------------------------------------- | ------- |
| `DB01_ENCRYPT` | Encrypt file after backing up with GPG | `FALSE` | | `DB01_ENCRYPT` | Encrypt file after backing up with GPG | `FALSE` |
@@ -488,7 +492,7 @@ Otherwise, override them per backup job. Additional backup jobs can be scheduled
| | Absolute HHMM, e.g. `2330` or `0415` | | | | Absolute HHMM, e.g. `2330` or `0415` | |
| | Relative +MM, i.e. how many minutes after starting the container, e.g. `+0` (immediate), `+10` (in 10 minutes), or `+90` in an hour and a half | | | | Relative +MM, i.e. how many minutes after starting the container, e.g. `+0` (immediate), `+10` (in 10 minutes), or `+90` in an hour and a half | |
| | Full datestamp e.g. `2023-12-21 23:30:00` | | | | Full datestamp e.g. `2023-12-21 23:30:00` | |
| | Cron expression e.g. `30 23 * * *` - [Understand the format](https://en.wikipedia.org/wiki/ Cron) - *BACKUP_INTERVAL is ignored* | | | | Cron expression e.g. `30 23 * * *` [Understand the format](https://en.wikipedia.org/wiki/Cron) - *BACKUP_INTERVAL is ignored* | |
| `DB01_CLEANUP_TIME` | Value in minutes to delete old backups (only fired when backup interval executes) | `FALSE` | | `DB01_CLEANUP_TIME` | Value in minutes to delete old backups (only fired when backup interval executes) | `FALSE` |
| | 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything. | | | | 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything. | |
| `DB01_ARCHIVE_TIME` | Value in minutes to move all files files older than (x) from `DB01_BACKUP_FILESYSTEM_PATH` | | | `DB01_ARCHIVE_TIME` | Value in minutes to move all files files older than (x) from `DB01_BACKUP_FILESYSTEM_PATH` | |
@@ -630,7 +634,7 @@ If `DB01_BACKUP_LOCATION` = `blobxfer` then the following options are used:.
| `DB01_BLOBXFER_STORAGE_ACCOUNT_KEY` | Microsoft Azure Cloud storage account key. | | x | | `DB01_BLOBXFER_STORAGE_ACCOUNT_KEY` | Microsoft Azure Cloud storage account key. | | x |
| `DB01_BLOBXFER_REMOTE_PATH` | Remote Azure path | `/docker-db-backup` | x | | `DB01_BLOBXFER_REMOTE_PATH` | Remote Azure path | `/docker-db-backup` | x |
> This service uploads files from backup target directory `DB01_BACKUP_FILESYSTEM_PATH`. > This service uploads files from backup directory `DB01_BACKUP_FILESYSTEM_PATH`.
> If the a cleanup configuration in `DB01_CLEANUP_TIME` is defined, the remote directory on Azure storage will also be cleaned automatically. > If the a cleanup configuration in `DB01_CLEANUP_TIME` is defined, the remote directory on Azure storage will also be cleaned automatically.
##### Hooks ##### Hooks
@@ -663,11 +667,11 @@ echo "${1} Backup Starting on ${2} for ${3} at ${4}. Filename: ${5}"
``` ```
## script DB01_TYPE DB01_HOST DB01_NAME STARTEPOCH BACKUP_FILENAME ## script DB01_TYPE DB01_HOST DB01_NAME STARTEPOCH BACKUP_FILENAME
${f} "${backup_job_db_type}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${target}" ${f} "${backup_job_db_type}" "${backup_job_db_host}" "${backup_job_db_name}" "${backup_routines_start_time}" "${backup_job_filename}"
Outputs the following on the console: Outputs the following on the console:
`mysql Backup Starting on example-db for example at 1647370800. Filename: mysql_example_example-db_202200315-000000.sql.bz2 `mysql Backup Starting on example-db for example at 1647370800. Filename: mysql_example_example-db_202200315-000000.sql.bz2`
###### Post backup ###### Post backup
@@ -694,7 +698,7 @@ echo "${1} ${2} Backup Completed on ${3} for ${4} on ${5} ending ${6} for a dura
``` ```
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE ## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_routines_start_time}" "${backup_routines_finish_time}" "${backup_routines_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" "${move_exit_code} ${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_routines_start_time}" "${backup_routines_finish_time}" "${backup_routines_total_time}" "${backup_job_filename}" "${filesize}" "${checksum_value}" "${move_exit_code}
Outputs the following on the console: Outputs the following on the console:

View File

@@ -29,7 +29,6 @@ bdgy="\e[100m" # Background Color Dark Gray
blr="\e[101m" # Background Color Light Red blr="\e[101m" # Background Color Light Red
boff="\e[49m" # Background Color Off boff="\e[49m" # Background Color Off
bootstrap_variables
if [ -z "${1}" ] ; then if [ -z "${1}" ] ; then
interactive_mode=true interactive_mode=true
@@ -78,7 +77,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 | sort -z | xargs -0) ) options=( $(find "${DEFAULT_BACKUP_PATH}" -type f -maxdepth 2 -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