Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9fbbcc6de | ||
|
|
64e876a9a4 | ||
|
|
694e54ca9c | ||
|
|
09bd6015ac | ||
|
|
5b8b0afec2 | ||
|
|
0cc7e574fe |
33
Readme.md
33
Readme.md
@@ -220,10 +220,10 @@ The postgres user must be added to the backup group for this, so that the basic
|
|||||||
|
|
||||||
### PostgreSQL Config variables
|
### PostgreSQL Config variables
|
||||||
|
|
||||||
Variable | Default | Description
|
| Variable | Default | Description |
|
||||||
| - | - | - |
|
| - | - | - |
|
||||||
DATABASE_FULL_DUMP | | if empty, dump per databse, if set dump all in one file, if set to schema dump only schema
|
| DATABASE_FULL_DUMP | | if empty, dump per databse, if set dump all in one file, if set to schema dump only schema |
|
||||||
DATABASE_USER | | overide username to connect to database
|
| DATABASE_USER | | overide username to connect to database |
|
||||||
|
|
||||||
### PostgreSQL Control files
|
### PostgreSQL Control files
|
||||||
|
|
||||||
@@ -239,10 +239,10 @@ If non root ident authentication run is used, be sure that the `mysql` user is i
|
|||||||
|
|
||||||
### MySQL Config variables
|
### MySQL Config variables
|
||||||
|
|
||||||
Variable | Default | Description
|
| Variable | Default | Description |
|
||||||
| - | - | - |
|
| - | - | - |
|
||||||
DATABASE_FULL_DUMP | | if empty, dump per databse, if set dump all in one file, if set to schema dump only schema
|
| DATABASE_FULL_DUMP | | if empty, dump per databse, if set dump all in one file, if set to schema dump only schema |
|
||||||
MYSQL_DB_CONFIG | | override file for connection. In modern mariaDB installations it is rcommended to run the script as root or mysql user and use the ident authentication instead.
|
| MYSQL_DB_CONFIG | | override file for connection. In modern mariaDB installations it is rcommended to run the script as root or mysql user and use the ident authentication instead. |
|
||||||
|
|
||||||
### MySQLControl files
|
### MySQLControl files
|
||||||
|
|
||||||
@@ -259,12 +259,13 @@ This user is neede to create the temporary dump folder and access for the git fi
|
|||||||
|
|
||||||
### gitea Config Variables
|
### gitea Config Variables
|
||||||
|
|
||||||
Variable | Default | Description
|
| Variable | Default | Description |
|
||||||
| - | - | - |
|
| - | - | - |
|
||||||
GIT_USER | git | The user that runs gitea |
|
| GIT_USER | git | The user that runs gitea |
|
||||||
GITEA_TMP | /tmp/gitea/ | Where the temporary dump files from the backup are stored, as user git |
|
| GITEA_WORKING_DIR | /var/tmp/gitea/ | Where the temporary dump files from the backup are stored, as user git |
|
||||||
GITEA_BIN | /usr/local/bin/gitea | Where the gitea binary is located |
|
| GITEA_TEMP_DIR | /var/tmp/ | General temporary folder |
|
||||||
GITEA_CONFIG | /etc/gitea/app.ini | The configuration file for gitea |
|
| GITEA_BIN | /usr/local/bin/gitea | Where the gitea binary is located |
|
||||||
|
| GITEA_CONFIG | /etc/gitea/app.ini | The configuration file for gitea |
|
||||||
|
|
||||||
### gitea Control files
|
### gitea Control files
|
||||||
|
|
||||||
@@ -274,12 +275,12 @@ There are no control files for gitea backup
|
|||||||
|
|
||||||
### zabbix Config Variables
|
### zabbix Config Variables
|
||||||
|
|
||||||
Variable | Default | Description
|
| Variable | Default | Description |
|
||||||
| - | - | - |
|
| - | - | - |
|
||||||
ZABBIX_DUMP | /usr/local/bin/zabbix-dump |
|
| ZABBIX_DUMP | /usr/local/bin/zabbix-dump | |
|
||||||
ZABBIX_DATABASE | '' | Must be set as either psql or mysql
|
| ZABBIX_DATABASE | '' | Must be set as either psql or mysql |
|
||||||
ZABBIX_CONFIG | '' | if not set uses default location
|
| ZABBIX_CONFIG | '' | if not set uses default location |
|
||||||
ZABBIX_UNKNOWN_TABLES | '' | if set, changed to -f (force)
|
| ZABBIX_UNKNOWN_TABLES | '' | if set, changed to -f (force) |
|
||||||
|
|
||||||
### zabbix Control files
|
### zabbix Control files
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# version for all general files
|
# version for all general files
|
||||||
VERSION="4.4.0";
|
VERSION="4.5.4";
|
||||||
|
|
||||||
# borg version and borg comamnd
|
# borg version and borg comamnd
|
||||||
BORG_VERSION="";
|
BORG_VERSION="";
|
||||||
@@ -95,7 +95,8 @@ PRINTF_INFO_STRING="%-23s: %s\n";
|
|||||||
PRINTF_MASTER_BLOCK="=== [%-8s: %19s] ==[%s]====================================>\n";
|
PRINTF_MASTER_BLOCK="=== [%-8s: %19s] ==[%s]====================================>\n";
|
||||||
PRINTF_SUB_BLOCK="|-- [%-8s: %19s] --[%s]------------------------------------>\n";
|
PRINTF_SUB_BLOCK="|-- [%-8s: %19s] --[%s]------------------------------------>\n";
|
||||||
PRINTF_SUBEXT_BLOCK="|-- [%-8s: %s: %19s] --[%s]------------------------------------>\n";
|
PRINTF_SUBEXT_BLOCK="|-- [%-8s: %s: %19s] --[%s]------------------------------------>\n";
|
||||||
PRINTF_DB_SUB_BLOCK=">>- [%-8s: %s] =======================[%s]====================================>\n";
|
PRINTF_DB_SUB_BLOCK="|>- [%-8s: %s] ==[%s]=======================>\n";
|
||||||
|
PRINTF_DB_RUN_TIME_SUB_BLOCK=">>- [%-8s: %s] ==[%s]==[Run time: %s]=======================>\n";
|
||||||
# opt flags
|
# opt flags
|
||||||
OPT_VERBOSE="";
|
OPT_VERBOSE="";
|
||||||
OPT_PROGRESS="";
|
OPT_PROGRESS="";
|
||||||
@@ -152,9 +153,11 @@ MYSQL_DB_CONFIG="";
|
|||||||
MYSQL_DB_CONFIG_PARAM="";
|
MYSQL_DB_CONFIG_PARAM="";
|
||||||
# gitea module
|
# gitea module
|
||||||
GIT_USER="";
|
GIT_USER="";
|
||||||
GITEA_TMP="";
|
GITEA_WORKING_DIR="";
|
||||||
|
GITEA_TEMP_DIR="";
|
||||||
GITEA_BIN="";
|
GITEA_BIN="";
|
||||||
GITEA_CONFIG="";
|
GITEA_CONFIG="";
|
||||||
|
GITEA_EXPORT_TYPE="";
|
||||||
# zabbix module
|
# zabbix module
|
||||||
ZABBIX_DUMP_BIN="";
|
ZABBIX_DUMP_BIN="";
|
||||||
ZABBIX_CONFIG="";
|
ZABBIX_CONFIG="";
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
# rename to borg.backup.gitea.settings to use
|
# rename to borg.backup.gitea.settings to use
|
||||||
|
|
||||||
# override settings in borg.backup.settings with SUB_ prefix
|
|
||||||
# valid for BACKUP_FILE, BACKUP_SET, COMPRESSION*, KEEP_*
|
|
||||||
|
|
||||||
GIT_USER="";
|
GIT_USER="";
|
||||||
GITEA_TMP="";
|
GITEA_WORKING_DIR="";
|
||||||
|
GITEA_TEMP_DIR="";
|
||||||
GITEA_BIN="";
|
GITEA_BIN="";
|
||||||
GITEA_CONFIG="";
|
GITEA_CONFIG="";
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Backup gitea database, all git folders and gitea settings
|
# Backup gitea database, all git folders and gitea settings
|
||||||
|
|
||||||
MODULE="gitea"
|
MODULE="gitea"
|
||||||
MODULE_VERSION="1.1.4";
|
MODULE_VERSION="1.2.0";
|
||||||
|
|
||||||
DIR="${BASH_SOURCE%/*}"
|
DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
||||||
@@ -29,9 +29,13 @@ if [ -z "${GIT_USER}" ]; then
|
|||||||
GIT_USER="git";
|
GIT_USER="git";
|
||||||
fi;
|
fi;
|
||||||
# set GITEA_* if not set
|
# set GITEA_* if not set
|
||||||
if [ -z "${GITEA_TMP}" ]; then
|
if [ -z "${GITEA_WORKING_DIR}" ]; then
|
||||||
# run gitea backup (user mktemp?)
|
# run gitea backup (user mktemp?)
|
||||||
GITEA_TMP="/tmp/gitea/";
|
GITEA_WORKING_DIR="/var/tmp/gitea/";
|
||||||
|
fi;
|
||||||
|
# general temp folder for temporary data storage, this is not working output folder
|
||||||
|
if [ -z "${GITEA_TEMP_DIR}"]; then
|
||||||
|
GITEA_TEMP_DIR="/var/tmp";
|
||||||
fi;
|
fi;
|
||||||
if [ -z "${GITEA_BIN}" ]; then
|
if [ -z "${GITEA_BIN}" ]; then
|
||||||
GITEA_BIN="/usr/local/bin/gitea";
|
GITEA_BIN="/usr/local/bin/gitea";
|
||||||
@@ -39,6 +43,10 @@ fi;
|
|||||||
if [ -z "${GITEA_CONFIG}" ]; then
|
if [ -z "${GITEA_CONFIG}" ]; then
|
||||||
GITEA_CONFIG="/etc/gitea/app.ini"
|
GITEA_CONFIG="/etc/gitea/app.ini"
|
||||||
fi;
|
fi;
|
||||||
|
# This one is not advertised in the config file as it is not recommended to change
|
||||||
|
if [ -z "${GITEA_EXPORT_TYPE}" ]; then
|
||||||
|
GITEA_EXPORT_TYPE="zip";
|
||||||
|
fi;
|
||||||
if [ ! -f "${GITEA_BIN}" ]; then
|
if [ ! -f "${GITEA_BIN}" ]; then
|
||||||
echo "[! $(date +'%F %T')] Cannot find gitea binary";
|
echo "[! $(date +'%F %T')] Cannot find gitea binary";
|
||||||
. "${DIR}/borg.backup.functions.close.sh" 1;
|
. "${DIR}/borg.backup.functions.close.sh" 1;
|
||||||
@@ -49,6 +57,16 @@ if [ ! -f "${GITEA_CONFIG}" ]; then
|
|||||||
. "${DIR}/borg.backup.functions.close.sh" 1;
|
. "${DIR}/borg.backup.functions.close.sh" 1;
|
||||||
exit 1;
|
exit 1;
|
||||||
fi;
|
fi;
|
||||||
|
# some basic checks with abort
|
||||||
|
if [ ! -d "${GITEA_TEMP_DIR}" ]; then
|
||||||
|
echo "Temp directory does not exist: ${GITEA_TEMP_DIR}";
|
||||||
|
exit;
|
||||||
|
fi;
|
||||||
|
# we should check GITEA_EXPORT_TYPE too at some point for an allow list
|
||||||
|
# At the moment warn if not zip
|
||||||
|
if [ "${GITEA_EXPORT_TYPE}" != "zip" ]; then
|
||||||
|
echo "[!!!!] The gitea export type has been changed from 'zip' to '${GITEA_EXPORT_TYPE}'. This can either break or make exports take very ling";
|
||||||
|
fi;
|
||||||
# Filename
|
# Filename
|
||||||
FILENAME="gitea.backup.zip";
|
FILENAME="gitea.backup.zip";
|
||||||
# backup set and prefix
|
# backup set and prefix
|
||||||
@@ -60,7 +78,7 @@ BORG_CALL=$(echo "${_BORG_CALL}" | sed -e "s/##FILENAME##/${FILENAME}/" | sed -e
|
|||||||
BORG_PRUNE=$(echo "${_BORG_PRUNE}" | sed -e "s/##BACKUP_SET_PREFIX##/${BACKUP_SET_PREFIX}/");
|
BORG_PRUNE=$(echo "${_BORG_PRUNE}" | sed -e "s/##BACKUP_SET_PREFIX##/${BACKUP_SET_PREFIX}/");
|
||||||
printf "${PRINTF_SUB_BLOCK}" "BACKUP: git data and database" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUB_BLOCK}" "BACKUP: git data and database" "$(date +'%F %T')" "${MODULE}";
|
||||||
if [ ${DEBUG} -eq 1 ] || [ ${DRYRUN} -eq 1 ]; then
|
if [ ${DEBUG} -eq 1 ] || [ ${DRYRUN} -eq 1 ]; then
|
||||||
echo "sudo -u ${GIT_USER} ${GITEA_BIN} dump -c ${GITEA_CONFIG} -w ${GITEA_TMP} -L -f - | ${BORG_CALL}";
|
echo "sudo -u ${GIT_USER} ${GITEA_BIN} dump -c ${GITEA_CONFIG} -w ${GITEA_WORKING_DIR} -t ${GITEA_TEMP_DIR} --type ${GITEA_EXPORT_TYPE} -L -f - | ${BORG_CALL}";
|
||||||
if [ -z "${ONE_TIME_TAG}" ]; then
|
if [ -z "${ONE_TIME_TAG}" ]; then
|
||||||
echo "${BORG_PRUNE}";
|
echo "${BORG_PRUNE}";
|
||||||
fi;
|
fi;
|
||||||
@@ -70,13 +88,13 @@ if [ ${DRYRUN} -eq 0 ]; then
|
|||||||
# below was an old workaround
|
# below was an old workaround
|
||||||
#export USER="${LOGNAME}" # workaround for broken gitea EUID check
|
#export USER="${LOGNAME}" # workaround for broken gitea EUID check
|
||||||
# make sure temp folder is there and is set as git. user
|
# make sure temp folder is there and is set as git. user
|
||||||
if [ ! -d "${GITEA_TMP}" ]; then
|
if [ ! -d "${GITEA_WORKING_DIR}" ]; then
|
||||||
mkdir -p "${GITEA_TMP}";
|
mkdir -p "${GITEA_WORKING_DIR}";
|
||||||
fi;
|
fi;
|
||||||
chown -R ${GIT_USER}. "${GITEA_TMP}";
|
chown -R ${GIT_USER}. "${GITEA_WORKING_DIR}";
|
||||||
# this needs to be run in a folder that can be stat by git user
|
# this needs to be run in a folder that can be stat by git user
|
||||||
cd "${GITEA_TMP}";
|
cd "${GITEA_WORKING_DIR}";
|
||||||
sudo -u ${GIT_USER} ${GITEA_BIN} dump -c ${GITEA_CONFIG} -w ${GITEA_TMP} -L -f - | ${BORG_CALL};
|
sudo -u ${GIT_USER} ${GITEA_BIN} dump -c ${GITEA_CONFIG} -w ${GITEA_WORKING_DIR} -t ${GITEA_TEMP_DIR} --type ${GITEA_EXPORT_TYPE} -L -f - | ${BORG_CALL};
|
||||||
) 2>&1 | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' # remove all ESC strings
|
) 2>&1 | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' # remove all ESC strings
|
||||||
fi;
|
fi;
|
||||||
if [ -z "${ONE_TIME_TAG}" ]; then
|
if [ -z "${ONE_TIME_TAG}" ]; then
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# set last edit date + time
|
# set last edit date + time
|
||||||
MODULE="mysql"
|
MODULE="mysql"
|
||||||
MODULE_VERSION="1.1.2";
|
MODULE_VERSION="1.1.3";
|
||||||
|
|
||||||
DIR="${BASH_SOURCE%/*}"
|
DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
||||||
@@ -93,6 +93,7 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
|||||||
SCHEMA_ONLY='--no-data';
|
SCHEMA_ONLY='--no-data';
|
||||||
schema_flag='schema';
|
schema_flag='schema';
|
||||||
fi;
|
fi;
|
||||||
|
LOCAL_START=$(date +'%s');
|
||||||
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "all databases" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "all databases" "$(date +'%F %T')" "${MODULE}";
|
||||||
# We only do a full backup and not per table backup here
|
# We only do a full backup and not per table backup here
|
||||||
# Filename
|
# Filename
|
||||||
@@ -124,9 +125,12 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
|||||||
echo "Prune repository with keep${KEEP_INFO:1}";
|
echo "Prune repository with keep${KEEP_INFO:1}";
|
||||||
${BORG_PRUNE};
|
${BORG_PRUNE};
|
||||||
fi;
|
fi;
|
||||||
|
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||||
|
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||||
else
|
else
|
||||||
${MYSQL_CMD} ${MYSQL_DB_CONFIG_PARAM} -B -N -e "show databases" |
|
${MYSQL_CMD} ${MYSQL_DB_CONFIG_PARAM} -B -N -e "show databases" |
|
||||||
while read db; do
|
while read db; do
|
||||||
|
LOCAL_START=$(date +'%s');
|
||||||
printf "${PRINTF_DB_SUB_BLOCK}" "DB" "${db}" "${MODULE}";
|
printf "${PRINTF_DB_SUB_BLOCK}" "DB" "${db}" "${MODULE}";
|
||||||
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "${db}" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "${db}" "$(date +'%F %T')" "${MODULE}";
|
||||||
# exclude checks
|
# exclude checks
|
||||||
@@ -213,6 +217,8 @@ else
|
|||||||
else
|
else
|
||||||
echo "- [E] ${db}";
|
echo "- [E] ${db}";
|
||||||
fi;
|
fi;
|
||||||
|
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||||
|
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||||
done;
|
done;
|
||||||
fi;
|
fi;
|
||||||
# run compact at the end if not a dry run
|
# run compact at the end if not a dry run
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# set last edit date + time
|
# set last edit date + time
|
||||||
MODULE="pgsql"
|
MODULE="pgsql"
|
||||||
MODULE_VERSION="1.2.2";
|
MODULE_VERSION="1.2.4";
|
||||||
|
|
||||||
|
|
||||||
DIR="${BASH_SOURCE%/*}"
|
DIR="${BASH_SOURCE%/*}"
|
||||||
@@ -102,6 +102,7 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
|||||||
SCHEMA_ONLY='-s';
|
SCHEMA_ONLY='-s';
|
||||||
schema_flag='schema';
|
schema_flag='schema';
|
||||||
fi;
|
fi;
|
||||||
|
LOCAL_START=$(date +'%s');
|
||||||
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "all databases" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "all databases" "$(date +'%F %T')" "${MODULE}";
|
||||||
# Filename
|
# Filename
|
||||||
FILENAME-"all.${DB_USER}.NONE.${schema_flag}-${DB_VERSION}_${DB_HOST}_${DB_PORT}.c.sql"
|
FILENAME-"all.${DB_USER}.NONE.${schema_flag}-${DB_VERSION}_${DB_HOST}_${DB_PORT}.c.sql"
|
||||||
@@ -132,10 +133,13 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
|||||||
echo "Prune repository with keep${KEEP_INFO:1}";
|
echo "Prune repository with keep${KEEP_INFO:1}";
|
||||||
${BORG_PRUNE};
|
${BORG_PRUNE};
|
||||||
fi;
|
fi;
|
||||||
|
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||||
|
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||||
else
|
else
|
||||||
# dump globals first
|
# dump globals first
|
||||||
db="pg_globals";
|
db="pg_globals";
|
||||||
schema_flag="data";
|
schema_flag="data";
|
||||||
|
LOCAL_START=$(date +'%s');
|
||||||
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "${db}" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "${db}" "$(date +'%F %T')" "${MODULE}";
|
||||||
# Filename
|
# Filename
|
||||||
FILENAME="${db}.${DB_USER}.NONE.${schema_flag}-${DB_VERSION}_${DB_HOST}_${DB_PORT}.c.sql"
|
FILENAME="${db}.${DB_USER}.NONE.${schema_flag}-${DB_VERSION}_${DB_HOST}_${DB_PORT}.c.sql"
|
||||||
@@ -166,9 +170,12 @@ else
|
|||||||
echo "Prune repository with keep${KEEP_INFO:1}";
|
echo "Prune repository with keep${KEEP_INFO:1}";
|
||||||
${BORG_PRUNE};
|
${BORG_PRUNE};
|
||||||
fi;
|
fi;
|
||||||
|
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||||
|
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "BACKUP" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||||
|
|
||||||
# get list of tables
|
# get list of tables
|
||||||
for owner_db in $(${PG_PSQL} -U ${DB_USER} ${CONN_DB_HOST} ${CONN_DB_PORT} -d template1 -t -A -F "," -X -q -c "SELECT pg_catalog.pg_get_userbyid(datdba) AS owner, datname, pg_catalog.pg_encoding_to_char(encoding) AS encoding FROM pg_catalog.pg_database WHERE datname "\!"~ 'template(0|1)' ORDER BY datname;"); do
|
for owner_db in $(${PG_PSQL} -U ${DB_USER} ${CONN_DB_HOST} ${CONN_DB_PORT} -d template1 -t -A -F "," -X -q -c "SELECT pg_catalog.pg_get_userbyid(datdba) AS owner, datname, pg_catalog.pg_encoding_to_char(encoding) AS encoding FROM pg_catalog.pg_database WHERE datname "\!"~ 'template(0|1)' ORDER BY datname;"); do
|
||||||
|
LOCAL_START=$(date +'%s');
|
||||||
# get the user who owns the DB too
|
# get the user who owns the DB too
|
||||||
owner=$(echo ${owner_db} | cut -d "," -f 1);
|
owner=$(echo ${owner_db} | cut -d "," -f 1);
|
||||||
db=$(echo ${owner_db} | cut -d "," -f 2);
|
db=$(echo ${owner_db} | cut -d "," -f 2);
|
||||||
@@ -265,6 +272,8 @@ else
|
|||||||
else
|
else
|
||||||
echo "- [E] ${db}";
|
echo "- [E] ${db}";
|
||||||
fi;
|
fi;
|
||||||
|
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||||
|
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||||
done;
|
done;
|
||||||
fi;
|
fi;
|
||||||
# run compact at the end if not a dry run
|
# run compact at the end if not a dry run
|
||||||
|
|||||||
Reference in New Issue
Block a user