Compare commits
No commits in common. "f366e7d97b11c00f5021723707dd952075aa5954" and "db2423ac43231956b21d8bde67f0ad7c7a4d7c03" have entirely different histories.
f366e7d97b
...
db2423ac43
@ -10,10 +10,6 @@ BORG_HOST="o26.oopen.de"
|
||||
BORG_REPO="/backup/mail-fm"
|
||||
BORG_PASSPHRASE='joG.Ir2x--VsX6/mxb.kEcmq'
|
||||
|
||||
BORG_HOST="o26.oopen.de"
|
||||
BORG_REPO="/backup/web-05"
|
||||
BORG_PASSPHRASE='FZyFW-bxXV-rHiQ7n/dAxI.L'
|
||||
|
||||
|
||||
SSH_USER="borg"
|
||||
SSH_PORT=22
|
||||
@ -59,7 +55,6 @@ export BORG_PASSPHRASE
|
||||
#
|
||||
# chattr +i /data/backup/<client-identifier>
|
||||
#
|
||||
chattr +i "$(dirname "${BORG_REPO}")"
|
||||
mkdir -p "${BORG_REPO}"
|
||||
chown ${SSH_USER}:${SSH_USER} "${BORG_REPO}"
|
||||
chattr +i "$(dirname "${BORG_REPO}")"
|
||||
|
@ -22,7 +22,6 @@ currentDateReadable=$(date --date @"$startTime" +"%d.%m.%Y - %H:%M:%S")
|
||||
clean_up() {
|
||||
|
||||
# Perform program exit housekeeping
|
||||
rm -f ${DB_BACKUP_DIR}/*-${backup_date}.sql
|
||||
rm -rf "$LOCK_DIR"
|
||||
blank_line
|
||||
exit $1
|
||||
@ -301,8 +300,8 @@ fi
|
||||
# By default: Borg won't follow symlinks
|
||||
#
|
||||
BORG_BACKUP_DIRS=""
|
||||
for _dir in $BACKUP_DIRECTORIES ; do
|
||||
if [[ -h "${_dir}" ]] ; then
|
||||
for _dir in $BACKUP_DIRECTORIES ; do
|
||||
if [[ -h "${_dir}" ]] ; then
|
||||
BORG_BACKUP_DIRS="$BORG_BACKUP_DIRS $(realpath "${_dir}")"
|
||||
fi
|
||||
BORG_BACKUP_DIRS="$BORG_BACKUP_DIRS ${_dir}"
|
||||
@ -325,7 +324,7 @@ export BORG_REPO
|
||||
# For 'Warning: The repository at location … was previously located at ..'
|
||||
#
|
||||
|
||||
# This has to be set when the repository has been created by user and
|
||||
# This has to be set when the repository has been created by user and
|
||||
# the script is called by cron
|
||||
#
|
||||
export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
|
||||
@ -440,14 +439,14 @@ EOF
|
||||
echononl "Dump Database '${_db}'.."
|
||||
|
||||
cat <<EOF >> ${BORG_LOG_FILE}
|
||||
mysqldump $MYSQL_CREDENTIALS \\
|
||||
mysqldump $MYSQL_CREDENTIALS \\
|
||||
--single-transaction --routines \\
|
||||
-h localhost \\
|
||||
-e ${_db} > ${DB_BACKUP_DIR}/${_db}-${backup_date}.sql
|
||||
|
||||
EOF
|
||||
|
||||
mysqldump $MYSQL_CREDENTIALS \
|
||||
mysqldump $MYSQL_CREDENTIALS \
|
||||
--single-transaction --routines \
|
||||
-h localhost \
|
||||
-e ${_db} > ${DB_BACKUP_DIR}/${_db}-${backup_date}.sql 2> ${log_file}
|
||||
@ -520,6 +519,7 @@ EOF
|
||||
done
|
||||
|
||||
fi
|
||||
clean_up 0
|
||||
|
||||
|
||||
echononl "Create borg backup.."
|
||||
|
@ -3,12 +3,7 @@
|
||||
script_name="$(basename $(realpath $0))"
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
|
||||
|
||||
if [[ -f "${working_dir}/conf/borg-backup-nc.conf" ]] ; then
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
else
|
||||
conf_file="${working_dir}/conf/borg-backup.conf"
|
||||
fi
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
|
||||
LOCK_DIR="/tmp/${script_name%%.*}.LOCK"
|
||||
log_file="${LOCK_DIR}/${script_name%%.*}.log"
|
||||
|
@ -3,11 +3,7 @@
|
||||
script_name="$(basename $(realpath $0))"
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
|
||||
if [[ -f "${working_dir}/conf/borg-backup-nc.conf" ]] ; then
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
else
|
||||
conf_file="${working_dir}/conf/borg-backup.conf"
|
||||
fi
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
|
||||
LOCK_DIR="/tmp/${script_name%%.*}.LOCK"
|
||||
log_file="${LOCK_DIR}/${script_name%%.*}.log"
|
||||
|
@ -3,12 +3,7 @@
|
||||
script_name="$(basename $(realpath $0))"
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
|
||||
|
||||
if [[ -f "${working_dir}/conf/borg-backup-nc.conf" ]] ; then
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
else
|
||||
conf_file="${working_dir}/conf/borg-backup.conf"
|
||||
fi
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
|
||||
LOCK_DIR="/tmp/${script_name%%.*}.LOCK"
|
||||
log_file="${LOCK_DIR}/${script_name%%.*}.log"
|
||||
|
@ -3,12 +3,7 @@
|
||||
script_name="$(basename $(realpath $0))"
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
|
||||
|
||||
if [[ -f "${working_dir}/conf/borg-backup-nc.conf" ]] ; then
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
else
|
||||
conf_file="${working_dir}/conf/borg-backup.conf"
|
||||
fi
|
||||
conf_file="${working_dir}/conf/borg-backup-nc.conf"
|
||||
|
||||
LOCK_DIR="/tmp/${script_name%%.*}.LOCK"
|
||||
log_file="${LOCK_DIR}/${script_name%%.*}.log"
|
||||
|
Loading…
x
Reference in New Issue
Block a user