mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 13:44:08 +01:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99153ac6d1 | ||
|
|
142967135d | ||
|
|
1df66853fb | ||
|
|
c019efeb74 | ||
|
|
f276af2512 | ||
|
|
4e41e66eff | ||
|
|
4488d113ef | ||
|
|
1cd014b165 | ||
|
|
39bd8537ff | ||
|
|
75ded7599c | ||
|
|
5e5986db69 | ||
|
|
1d61f40d0c | ||
|
|
ee8bbb370b | ||
|
|
ae201814fa | ||
|
|
bf8bce0893 | ||
|
|
3e8585394d | ||
|
|
2e0c0d9248 | ||
|
|
c81d8e2713 | ||
|
|
b808b35624 | ||
|
|
e060aeb0e5 | ||
|
|
03c16cc582 | ||
|
|
e45d916b00 |
110
.github/workflows/manual.yml
vendored
Normal file
110
.github/workflows/manual.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Manual Workflow (Application)
|
||||||
|
|
||||||
|
name: manual
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
Manual Build:
|
||||||
|
description: 'Manual Build'
|
||||||
|
required: false
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=${GITHUB_REPOSITORY/docker-/}
|
||||||
|
set -x
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
if [[ $GITHUB_REF == refs/heads/*/* ]] ; then
|
||||||
|
BRANCH="${DOCKER_IMAGE}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")"
|
||||||
|
else
|
||||||
|
BRANCH=${GITHUB_REF#refs/heads/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
case ${BRANCH} in
|
||||||
|
"main" | "master" )
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:latest"
|
||||||
|
;;
|
||||||
|
"develop" )
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:develop"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
if [ -n "${{ secrets.LATEST }}" ] ; then
|
||||||
|
if [ "${BRANCHTAG}" = "${{ secrets.LATEST }}" ]; then
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest,${DOCKER_IMAGE}:latest"
|
||||||
|
else
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
GITTAG="${DOCKER_IMAGE}:$(echo $GITHUB_REF | sed 's|refs/tags/||g')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${BRANCHTAG}" ] && [ -n "${GITTAG}" ]; then
|
||||||
|
TAGS=${BRANCHTAG},${GITTAG}
|
||||||
|
else
|
||||||
|
TAGS="${BRANCHTAG}${GITTAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Label
|
||||||
|
id: Label
|
||||||
|
run: |
|
||||||
|
if [ -f "Dockerfile" ] ; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_commit=\"${GITHUB_SHA}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_committed_by=\"${GITHUB_ACTOR}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" Dockerfile
|
||||||
|
if [ -f "CHANGELOG.md" ] ; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" Dockerfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_tag=\"${GITHUB_REF#refs/tags/v}\"" Dockerfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_branch=\"${GITHUB_REF#refs/heads/}\"" Dockerfile
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
64
CHANGELOG.md
64
CHANGELOG.md
@@ -1,3 +1,67 @@
|
|||||||
|
## 2.9.5 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for 2.9.3
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.4 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add Zabbix auto register support for templates
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.3 2021-11-24 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Alpine 3.15 base
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.2 2021-10-22 <teenigma@github>
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix compression failing on Redis backup
|
||||||
|
|
||||||
|
## 2.9.1 2021-10-15 <sbrunecker@github>
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Allow MariaDB 8.0 servers to be backed up
|
||||||
|
- Fixed DB available check getting stuck with empty password
|
||||||
|
|
||||||
|
## 2.9.0 2021-10-15 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Postgresql 14 Support (compiled)
|
||||||
|
- MSSQL 17.8.1.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.8.2 2021-10-15 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Change to using aws cli from Alpine repositories (fixes #81)
|
||||||
|
|
||||||
|
|
||||||
|
## 2.8.1 2021-09-01 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Modernize image with updated environment varialbes from upstream
|
||||||
|
|
||||||
|
|
||||||
|
## 2.8.0 2021-08-27 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Alpine 3.14 Base
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for syntax error in 2.7.0 Release (Credit the1ts@github)
|
||||||
|
- Cleanup image and leftover cache with AWS CLI installation
|
||||||
|
|
||||||
|
|
||||||
|
## 2.7.0 2021-06-17 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- MongoDB Authentication Database support (DB_AUTH)
|
||||||
|
|
||||||
|
|
||||||
## 2.6.1 2021-06-08 <jwillmer@github>
|
## 2.6.1 2021-06-08 <jwillmer@github>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
122
Dockerfile
122
Dockerfile
@@ -1,14 +1,108 @@
|
|||||||
FROM tiredofit/alpine:3.14
|
FROM docker.io/tiredofit/alpine:3.15
|
||||||
|
|
||||||
### Set Environment Variables
|
### Set Environment Variables
|
||||||
ENV MSSQL_VERSION=17.5.2.1-1 \
|
ENV MSSQL_VERSION=17.8.1.1-1 \
|
||||||
ENABLE_CRON=FALSE \
|
CONTAINER_ENABLE_MESSAGING=FALSE \
|
||||||
ENABLE_SMTP=FALSE \
|
CONTAINER_ENABLE_MONITORING=TRUE
|
||||||
ENABLE_ZABBIX=TRUE \
|
|
||||||
ZABBIX_HOSTNAME=db-backup
|
|
||||||
|
|
||||||
### Dependencies
|
ENV LANG=en_US.utf8 \
|
||||||
|
PG_MAJOR=14 \
|
||||||
|
PG_VERSION=14.0 \
|
||||||
|
PGDATA=/var/lib/postgresql/data
|
||||||
|
|
||||||
|
### Create User Accounts
|
||||||
RUN set -ex && \
|
RUN set -ex && \
|
||||||
|
addgroup -g 70 postgres && \
|
||||||
|
adduser -S -D -H -h /var/lib/postgresql -s /bin/sh -G postgres -u 70 postgres && \
|
||||||
|
mkdir -p /var/lib/postgresql && \
|
||||||
|
chown -R postgres:postgres /var/lib/postgresql && \
|
||||||
|
\
|
||||||
|
### Install Dependencies
|
||||||
|
apk update && \
|
||||||
|
apk upgrade && \
|
||||||
|
apk add \
|
||||||
|
openssl \
|
||||||
|
&& \
|
||||||
|
\
|
||||||
|
apk add --no-cache --virtual .postgres-build-deps \
|
||||||
|
bison \
|
||||||
|
build-base \
|
||||||
|
coreutils \
|
||||||
|
dpkg-dev \
|
||||||
|
dpkg \
|
||||||
|
flex \
|
||||||
|
gcc \
|
||||||
|
icu-dev \
|
||||||
|
libc-dev \
|
||||||
|
libedit-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
linux-headers \
|
||||||
|
make \
|
||||||
|
openssl-dev \
|
||||||
|
perl-utils \
|
||||||
|
perl-ipc-run \
|
||||||
|
util-linux-dev \
|
||||||
|
zlib-dev \
|
||||||
|
&& \
|
||||||
|
\
|
||||||
|
### Build Postgresql
|
||||||
|
mkdir -p /usr/src/postgresql && \
|
||||||
|
curl -sSL "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" | tar xvfj - --strip 1 -C /usr/src/postgresql && \
|
||||||
|
cd /usr/src/postgresql && \
|
||||||
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new && \
|
||||||
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new && \
|
||||||
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h && \
|
||||||
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && \
|
||||||
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' && \
|
||||||
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' && \
|
||||||
|
./configure \
|
||||||
|
--build="$gnuArch" \
|
||||||
|
--enable-integer-datetimes \
|
||||||
|
--enable-thread-safety \
|
||||||
|
--enable-tap-tests \
|
||||||
|
--disable-rpath \
|
||||||
|
--with-uuid=e2fs \
|
||||||
|
--with-gnu-ld \
|
||||||
|
--with-pgport=5432 \
|
||||||
|
--with-system-tzdata=/usr/share/zoneinfo \
|
||||||
|
--prefix=/usr/local \
|
||||||
|
--with-includes=/usr/local/include \
|
||||||
|
--with-libraries=/usr/local/lib \
|
||||||
|
--with-openssl \
|
||||||
|
--with-libxml \
|
||||||
|
--with-libxslt \
|
||||||
|
--with-icu \
|
||||||
|
&& \
|
||||||
|
\
|
||||||
|
make -j "$(nproc)" world && \
|
||||||
|
make install-world && \
|
||||||
|
make -C contrib install && \
|
||||||
|
runDeps="$( \
|
||||||
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
|
| tr ',' '\n' \
|
||||||
|
| sort -u \
|
||||||
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
|
)" && \
|
||||||
|
apk add -t .postgres-additional-deps \
|
||||||
|
$runDeps \
|
||||||
|
&& \
|
||||||
|
\
|
||||||
|
### Cleanup
|
||||||
|
apk del .postgres-build-deps && \
|
||||||
|
cd / && \
|
||||||
|
rm -rf \
|
||||||
|
/usr/src/postgresql \
|
||||||
|
/usr/local/share/doc \
|
||||||
|
/usr/local/share/man && \
|
||||||
|
find /usr/local -name '*.a' -delete && \
|
||||||
|
rm -rf /var/cache/apk/* && \
|
||||||
|
\
|
||||||
|
### Dependencies
|
||||||
|
set -ex && \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add -t .db-backup-build-deps \
|
apk add -t .db-backup-build-deps \
|
||||||
@@ -20,15 +114,17 @@ RUN set -ex && \
|
|||||||
&& \
|
&& \
|
||||||
\
|
\
|
||||||
apk add --no-cache -t .db-backup-run-deps \
|
apk add --no-cache -t .db-backup-run-deps \
|
||||||
|
aws-cli \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
influxdb \
|
influxdb \
|
||||||
libarchive \
|
libarchive \
|
||||||
mariadb-client \
|
mariadb-client \
|
||||||
|
mariadb-connector-c \
|
||||||
mongodb-tools \
|
mongodb-tools \
|
||||||
libressl \
|
libressl \
|
||||||
pigz \
|
pigz \
|
||||||
postgresql \
|
#postgresql \ # To reactivate when it appears in official repos with Alpine 3.15
|
||||||
postgresql-client \
|
#postgresql-client \ # To reactivate when it appears in official repos with Alpine 3.15
|
||||||
redis \
|
redis \
|
||||||
sqlite \
|
sqlite \
|
||||||
xz \
|
xz \
|
||||||
@@ -61,13 +157,7 @@ RUN set -ex && \
|
|||||||
### Cleanup
|
### Cleanup
|
||||||
apk del .db-backup-build-deps && \
|
apk del .db-backup-build-deps && \
|
||||||
rm -rf /usr/src/* && \
|
rm -rf /usr/src/* && \
|
||||||
rm -rf /tmp/* /var/cache/apk/*
|
rm -rf /root/.cache /tmp/* /var/cache/apk/*
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
python3 \
|
|
||||||
py3-pip \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install awscli
|
|
||||||
|
|
||||||
### S6 Setup
|
### S6 Setup
|
||||||
ADD install /
|
ADD install /
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2020 Dave Conroy
|
Copyright (c) 2021 Dave Conroy
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
pkill bash
|
pkill bash
|
||||||
|
|
||||||
|
|||||||
17
install/etc/cont-init.d/10-db-backup
Executable file
17
install/etc/cont-init.d/10-db-backup
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
source /assets/functions/00-container
|
||||||
|
prepare_service single
|
||||||
|
PROCESS_NAME="monitoring"
|
||||||
|
output_off
|
||||||
|
|
||||||
|
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
|
||||||
|
source /assets/defaults/03-monitoring
|
||||||
|
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
|
||||||
|
|
||||||
|
liftoff
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
source /assets/functions/00-container
|
source /assets/functions/00-container
|
||||||
|
|
||||||
PROCESS_NAME="db-backup"
|
PROCESS_NAME="db-backup"
|
||||||
|
|
||||||
date >/dev/null
|
date >/dev/null
|
||||||
@@ -35,6 +34,7 @@ case "$dbtype" in
|
|||||||
dbport=${DB_PORT:-27017}
|
dbport=${DB_PORT:-27017}
|
||||||
[[ ( -n "${DB_USER}" ) || ( -n "${DB_USER_FILE}" ) ]] && file_env 'DB_USER'
|
[[ ( -n "${DB_USER}" ) || ( -n "${DB_USER_FILE}" ) ]] && file_env 'DB_USER'
|
||||||
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||||
|
;;
|
||||||
"mysql" | "MYSQL" | "mariadb" | "MARIADB")
|
"mysql" | "MYSQL" | "mariadb" | "MARIADB")
|
||||||
dbtype=mysql
|
dbtype=mysql
|
||||||
dbport=${DB_PORT:-3306}
|
dbport=${DB_PORT:-3306}
|
||||||
@@ -236,13 +236,16 @@ backup_redis() {
|
|||||||
ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}')
|
ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}')
|
||||||
if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then
|
if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then
|
||||||
print_info "Redis Backup Complete"
|
print_info "Redis Backup Complete"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
try=$((try - 1))
|
try=$((try - 1))
|
||||||
print_info "Redis Busy - Waiting and retrying in 5 seconds"
|
print_info "Redis Busy - Waiting and retrying in 5 seconds"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
generate_md5
|
target_original=${target}
|
||||||
compression
|
compression
|
||||||
|
$dumpoutput "${tmpdir}/${target_original}"
|
||||||
|
generate_md5
|
||||||
move_backup
|
move_backup
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,8 +294,9 @@ check_availability() {
|
|||||||
;;
|
;;
|
||||||
"mysql" )
|
"mysql" )
|
||||||
COUNTER=0
|
COUNTER=0
|
||||||
|
export MYSQL_PWD=${dbpass}
|
||||||
while true; do
|
while true; do
|
||||||
mysqlcmd='mysql -u'${dbuser}' -P '${dbport}' -h '${dbhost}' -p'${dbpass}
|
mysqlcmd='mysql -u'${dbuser}' -P '${dbport}' -h '${dbhost}
|
||||||
out="$($mysqlcmd -e "SELECT COUNT(*) FROM information_schema.FILES;" 2>&1)"
|
out="$($mysqlcmd -e "SELECT COUNT(*) FROM information_schema.FILES;" 2>&1)"
|
||||||
echo "$out" | grep -E "COUNT|Enter" 2>&1 > /dev/null
|
echo "$out" | grep -E "COUNT|Enter" 2>&1 > /dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@@ -496,7 +500,7 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
### Zabbix
|
### Zabbix
|
||||||
if var_true "$ENABLE_ZABBIX" ; then
|
if var_true "$CONTAINER_ENABLE_MONITORING}" ; then
|
||||||
print_notice "Sending Backup Statistics to Zabbix"
|
print_notice "Sending Backup Statistics to Zabbix"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
||||||
|
|||||||
Reference in New Issue
Block a user