Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86b0fa122a | ||
|
|
32c320be27 | ||
|
|
500ab01790 | ||
|
|
ab58ab3ad0 | ||
|
|
7767eb58df |
@@ -11,8 +11,10 @@
|
|||||||
# debug and dry run
|
# debug and dry run
|
||||||
DEBUG=0;
|
DEBUG=0;
|
||||||
DRYRUN=0;
|
DRYRUN=0;
|
||||||
|
PGSQL_SUDO=1;
|
||||||
# options
|
# options
|
||||||
OPT_REMOTE="";
|
OPT_REMOTE="";
|
||||||
|
PGSQL_SUDO_USER="postgres";
|
||||||
# basic settings needed
|
# basic settings needed
|
||||||
TARGET_USER="";
|
TARGET_USER="";
|
||||||
TARGET_HOST="";
|
TARGET_HOST="";
|
||||||
@@ -27,11 +29,14 @@ MODULE_LIST="file gitea mysql pgsql zabbix"
|
|||||||
# basic options
|
# basic options
|
||||||
# -c for config file override
|
# -c for config file override
|
||||||
# -n for dry run test
|
# -n for dry run test
|
||||||
while getopts ":c:nd" opt; do
|
while getopts ":c:snd" opt; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
c|config)
|
c|config)
|
||||||
BASE_FOLDER=${OPTARG};
|
BASE_FOLDER=${OPTARG};
|
||||||
;;
|
;;
|
||||||
|
s|nosudo)
|
||||||
|
PGSQL_SUDO=0;
|
||||||
|
;;
|
||||||
d|debug)
|
d|debug)
|
||||||
DEBUG=1;
|
DEBUG=1;
|
||||||
;;
|
;;
|
||||||
@@ -96,8 +101,9 @@ for MODULE in ${MODULE_LIST}; do
|
|||||||
# .config/borg/security/<postgresql repo id>
|
# .config/borg/security/<postgresql repo id>
|
||||||
# .cache/borg/<postgresql repo id>
|
# .cache/borg/<postgresql repo id>
|
||||||
CMD_PREFIX="";
|
CMD_PREFIX="";
|
||||||
if [ "${MODULE}" = "pgsql" ]; then
|
# only sudo to pgsql if sudo is set to true
|
||||||
CMD_PREFIX="sudo -E -u postgres ";
|
if [ "${MODULE}" = "pgsql" ] && [ "${PGSQL_SUDO}" = "1" ]; then
|
||||||
|
CMD_PREFIX="sudo -E -u ${PGSQL_SUDO_USER} ";
|
||||||
fi;
|
fi;
|
||||||
echo "==== REPOSITORY: ${REPOSITORY}";
|
echo "==== REPOSITORY: ${REPOSITORY}";
|
||||||
borg list ${OPT_REMOTE} --format '{archive}{NL}' ${REPOSITORY}|grep -v "${MODULE},"|
|
borg list ${OPT_REMOTE} --format '{archive}{NL}' ${REPOSITORY}|grep -v "${MODULE},"|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if [ ! -w "${HOME}" ] || [ "${HOME}" = '/' ]; then
|
|||||||
fi;
|
fi;
|
||||||
|
|
||||||
# keep optionfs (for files)
|
# keep optionfs (for files)
|
||||||
KEEP_OPTIONS=();
|
KEEP_OPTIONS=("");
|
||||||
# keep info string (for files)
|
# keep info string (for files)
|
||||||
KEEP_INFO="";
|
KEEP_INFO="";
|
||||||
# override standard keep for tagged backups
|
# override standard keep for tagged backups
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# unset borg settings
|
# unset borg settings
|
||||||
unset BORG_BASE_DIR BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK BORG_RELOCATED_REPO_ACCESS_IS_OK
|
unset BORG_BASE_DIR BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK BORG_RELOCATED_REPO_ACCESS_IS_OK
|
||||||
# error abort without duration and error notice
|
# error abort without duration and error notice
|
||||||
if [ $1 == 1 ]; then
|
if [ $# -ge 1 ] && [ $1 -eq 1 ]; then
|
||||||
echo "=== [ERROR: $(date +'%F %T')] ==[${MODULE}]====================================>";
|
echo "=== [ERROR: $(date +'%F %T')] ==[${MODULE}]====================================>";
|
||||||
else
|
else
|
||||||
DURATION=$[ $(date +'%s')-$START ];
|
DURATION=$[ $(date +'%s')-$START ];
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# version for all general files
|
# version for all general files
|
||||||
VERSION="4.1.2";
|
VERSION="4.2.3";
|
||||||
|
|
||||||
# borg version and borg comamnd
|
# borg version and borg comamnd
|
||||||
BORG_VERSION="";
|
BORG_VERSION="";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
# set last edit date + time
|
# set last edit date + time
|
||||||
MODULE="pgsql"
|
MODULE="pgsql"
|
||||||
MODULE_VERSION="1.1.1";
|
MODULE_VERSION="1.2.0";
|
||||||
|
|
||||||
|
|
||||||
DIR="${BASH_SOURCE%/*}"
|
DIR="${BASH_SOURCE%/*}"
|
||||||
|
|||||||
Reference in New Issue
Block a user