mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-23 14:13:43 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa1dde53c0 | ||
|
|
789a9e5f5a | ||
|
|
b80d61f997 | ||
|
|
9e23def7b4 | ||
|
|
ca31eb840d | ||
|
|
6bec188633 | ||
|
|
43562077b0 | ||
|
|
c39bdeebae | ||
|
|
36b5909483 | ||
|
|
6033b1b0a9 |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -105,6 +105,6 @@ jobs:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
|
||||
2
.github/workflows/manual.yml
vendored
2
.github/workflows/manual.yml
vendored
@@ -105,6 +105,6 @@ jobs:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
|
||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,3 +1,22 @@
|
||||
## 2.11.3 2022-02-09 <dave at tiredofit dot ca>
|
||||
|
||||
### Changed
|
||||
- Rework to support new base image
|
||||
|
||||
|
||||
## 2.11.2 2022-02-09 <dave at tiredofit dot ca>
|
||||
|
||||
### Changed
|
||||
- Refresh base image
|
||||
|
||||
|
||||
## 2.11.1 2022-01-20 <jacksgt@github>
|
||||
|
||||
### Changed
|
||||
- Modernized S3 variables and sanity checks
|
||||
- Change exit code to 0 when executing a manual backup
|
||||
|
||||
|
||||
## 2.11.0 2022-01-20 <dave at tiredofit dot ca>
|
||||
|
||||
### Added
|
||||
|
||||
@@ -3,7 +3,9 @@ FROM docker.io/tiredofit/alpine:3.15
|
||||
### Set Environment Variables
|
||||
ENV MSSQL_VERSION=17.8.1.1-1 \
|
||||
CONTAINER_ENABLE_MESSAGING=FALSE \
|
||||
CONTAINER_ENABLE_MONITORING=TRUE
|
||||
CONTAINER_ENABLE_MONITORING=TRUE \
|
||||
IMAGE_NAME="tiredofit/db-backup" \
|
||||
IMAGE_REPO_URL="https://github.com/tiredofit/docker-db-backup/"
|
||||
|
||||
### Dependencies
|
||||
RUN set -ex && \
|
||||
|
||||
11
README.md
11
README.md
@@ -135,7 +135,10 @@ Be sure to view the following repositories to understand all the customizable op
|
||||
| `SPLIT_DB` | If using root as username and multiple DBs on system, set to TRUE to create Seperate DB Backups instead of all in one. | `FALSE` |
|
||||
| `TEMP_LOCATION` | Perform Backups and Compression in this temporary directory | `/tmp/backups/` |
|
||||
|
||||
When using compression with MongoDB, only `GZ` compression is possible.
|
||||
- When using compression with MongoDB, only `GZ` compression is possible.
|
||||
- You may need to wrap your `DB_DUMP_BEGIN` value in quotes for it to properly parse. There have been reports of backups that start with a `0` get converted into a different format which will not allow the timer to start at the correct time.
|
||||
|
||||
|
||||
|
||||
#### Backing Up to S3 Compatible Services
|
||||
|
||||
@@ -143,13 +146,13 @@ If `BACKUP_LOCATION` = `S3` then the following options are used.
|
||||
|
||||
| Parameter | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------- |
|
||||
| `S3_BUCKET` | S3 Bucket name e.g. 'mybucket' |
|
||||
| `S3_HOST` | Hostname of S3 Server e.g "s3.amazonaws.com" - You can also include a port if necessary |
|
||||
| `S3_BUCKET` | S3 Bucket name e.g. `mybucket` |
|
||||
| `S3_KEY_ID` | S3 Key ID |
|
||||
| `S3_KEY_SECRET` | S3 Key Secret |
|
||||
| `S3_PATH` | S3 Pathname to save to e.g. '`backup`' |
|
||||
| `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` |
|
||||
| `S3_REGION` | Define region in which bucket is defined. Example: `ap-northeast-2` |
|
||||
| `S3_HOST` | Hostname (and port) of S3-compatible service, e.g. `minio:8080`. Defaults to AWS. |
|
||||
| `S3_PROTOCOL` | Protocol to connect to `S3_HOST`. Either `http` or `https`. Defaults to `https`. |
|
||||
|
||||
|
||||
## Maintenance
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
pkill bash
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
source /assets/functions/00-container
|
||||
prepare_service single
|
||||
@@ -6,12 +6,6 @@ prepare_service 03-monitoring
|
||||
PROCESS_NAME="db-backup"
|
||||
output_off
|
||||
|
||||
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
|
||||
cat <<EOF > "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_dbbackup.conf
|
||||
# Zabbix DB Backup Configuration - Automatically Generated
|
||||
# Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-dbbackup
|
||||
# Autoregister=dbbackup
|
||||
EOF
|
||||
fi
|
||||
create_zabbix dbbackup
|
||||
|
||||
liftoff
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
source /assets/functions/00-container
|
||||
PROCESS_NAME="db-backup"
|
||||
@@ -82,13 +82,11 @@ SIZE_VALUE=${SIZE_VALUE:-"bytes"}
|
||||
SPLIT_DB=${SPLIT_DB:-"FALSE"}
|
||||
TEMP_LOCATION=${TEMP_LOCATION:-"/tmp/backups"}
|
||||
|
||||
if [ "$BACKUP_TYPE" = "S3" ] || [ "$BACKUP_TYPE" = "s3" ] || [ "$BACKUP_TYPE" = "MINIO" ] || [ "$BACKUP_TYPE" = "minio" ] ; then
|
||||
if [ "$BACKUP_LOCATION" = "S3" ] || [ "$BACKUP_LOCATION" = "s3" ] || [ "$BACKUP_LOCATION" = "MINIO" ] || [ "$BACKUP_LOCATION" = "minio" ] ; then
|
||||
S3_PROTOCOL=${S3_PROTOCOL:-"https"}
|
||||
sanity_var S3_HOST "S3 Host"
|
||||
sanity_var S3_BUCKET "S3 Bucket"
|
||||
sanity_var S3_KEY_ID "S3 Key ID"
|
||||
sanity_var S3_KEY_SECRET "S3 Key Secret"
|
||||
sanity_var S3_URI_STYLE "S3 URI Style (Virtualhost or Path)"
|
||||
sanity_var S3_PATH "S3 Path"
|
||||
sanity_var S3_REGION "S3 Region"
|
||||
file_env 'S3_KEY_ID'
|
||||
@@ -529,7 +527,7 @@ print_debug "Backup routines Initialized on $(date)"
|
||||
|
||||
### Go back to Sleep until next Backup time
|
||||
if var_true $MANUAL ; then
|
||||
exit 1;
|
||||
exit 0;
|
||||
else
|
||||
sleep $(($DB_DUMP_FREQ*60))
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
echo '** Performing Manual Backup'
|
||||
/etc/services.available/10-db-backup/run NOW
|
||||
|
||||
Reference in New Issue
Block a user