Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98890b87f5 | ||
|
|
a5bc90bb89 | ||
|
|
5af6a84d5f | ||
|
|
14d71f3053 | ||
|
|
24d4fb694f | ||
|
|
f9fbbcc6de | ||
|
|
64e876a9a4 | ||
|
|
694e54ca9c |
@@ -24,7 +24,7 @@ function version {
|
||||
}
|
||||
|
||||
# version for all general files
|
||||
VERSION="4.4.0";
|
||||
VERSION="4.5.4";
|
||||
|
||||
# borg version and borg comamnd
|
||||
BORG_VERSION="";
|
||||
@@ -95,8 +95,8 @@ PRINTF_INFO_STRING="%-23s: %s\n";
|
||||
PRINTF_MASTER_BLOCK="=== [%-8s: %19s] ==[%s]====================================>\n";
|
||||
PRINTF_SUB_BLOCK="|-- [%-8s: %19s] --[%s]------------------------------------>\n";
|
||||
PRINTF_SUBEXT_BLOCK="|-- [%-8s: %s: %19s] --[%s]------------------------------------>\n";
|
||||
PRINTF_DB_SUB_BLOCK=">>- [%-8s: %s] ==[%s]=======================>\n";
|
||||
PRINTF_DB_RUN_TIME_SUB_BLOCK=">>- [%-8s: %s] ==[%s]==[Run time: %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_VERBOSE="";
|
||||
OPT_PROGRESS="";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Backup gitea database, all git folders and gitea settings
|
||||
|
||||
MODULE="gitea"
|
||||
MODULE_VERSION="1.2.0";
|
||||
MODULE_VERSION="1.2.1";
|
||||
|
||||
DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
||||
@@ -91,7 +91,7 @@ if [ ${DRYRUN} -eq 0 ]; then
|
||||
if [ ! -d "${GITEA_WORKING_DIR}" ]; then
|
||||
mkdir -p "${GITEA_WORKING_DIR}";
|
||||
fi;
|
||||
chown -R ${GIT_USER}. "${GITEA_WORKING_DIR}";
|
||||
chown -R ${GIT_USER}: "${GITEA_WORKING_DIR}";
|
||||
# this needs to be run in a folder that can be stat by git user
|
||||
cd "${GITEA_WORKING_DIR}";
|
||||
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};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# set last edit date + time
|
||||
MODULE="mysql"
|
||||
MODULE_VERSION="1.1.3";
|
||||
MODULE_VERSION="1.1.4";
|
||||
|
||||
DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
|
||||
@@ -126,7 +126,7 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
||||
${BORG_PRUNE};
|
||||
fi;
|
||||
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "all databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
else
|
||||
${MYSQL_CMD} ${MYSQL_DB_CONFIG_PARAM} -B -N -e "show databases" |
|
||||
while read db; do
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# set last edit date + time
|
||||
MODULE="pgsql"
|
||||
MODULE_VERSION="1.2.3";
|
||||
MODULE_VERSION="1.2.7";
|
||||
|
||||
|
||||
DIR="${BASH_SOURCE%/*}"
|
||||
@@ -105,7 +105,7 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
||||
LOCAL_START=$(date +'%s');
|
||||
printf "${PRINTF_SUBEXT_BLOCK}" "BACKUP" "all databases" "$(date +'%F %T')" "${MODULE}";
|
||||
# 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"
|
||||
# backup set:
|
||||
BACKUP_SET_PREFIX="${MODULE},all-";
|
||||
BACKUP_SET_NAME="${ONE_TIME_TAG}${BACKUP_SET_PREFIX}${schema_flag}-${BACKUP_SET}";
|
||||
@@ -134,7 +134,7 @@ if [ ! -z "${DATABASE_FULL_DUMP}" ]; then
|
||||
${BORG_PRUNE};
|
||||
fi;
|
||||
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "all databases" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
else
|
||||
# dump globals first
|
||||
db="pg_globals";
|
||||
@@ -170,7 +170,8 @@ else
|
||||
echo "Prune repository with keep${KEEP_INFO:1}";
|
||||
${BORG_PRUNE};
|
||||
fi;
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "BACKUP" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
|
||||
# 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
|
||||
@@ -271,6 +272,7 @@ else
|
||||
else
|
||||
echo "- [E] ${db}";
|
||||
fi;
|
||||
DURATION=$[ $(date +'%s')-$LOCAL_START ];
|
||||
printf "${PRINTF_DB_RUN_TIME_SUB_BLOCK}" "DONE" "${db}" "${MODULE}" "$(convert_time ${DURATION})";
|
||||
done;
|
||||
fi;
|
||||
|
||||
Reference in New Issue
Block a user