Autogenerate lockfiles based on BORG_REPO
parent
c6c34e3bcc
commit
fe2cda0598
|
|
@ -171,8 +171,8 @@ exit_clean () {
|
|||
|
||||
# Default parameters
|
||||
CONFIG="/etc/borgwrapper/config.sh"
|
||||
LOCKFILE="/var/lock/borgwrapper.lock"
|
||||
BORG="/usr/bin/borg"
|
||||
LOCKDIR="/run/lock/borgwrapper"
|
||||
PRE_BACKUP_CMD=()
|
||||
POST_BACKUP_CMD=()
|
||||
POST_VERIFY_CMD=()
|
||||
|
|
@ -198,6 +198,9 @@ echo "Loading config from ${CONFIG}"
|
|||
source "${CONFIG}" || exit 1
|
||||
export BORG_PASSPHRASE
|
||||
|
||||
LOCKFILE="${LOCKDIR}/$(echo -n "${BORG_REPO}" | md5sum | cut -d ' ' -f 1).lock"
|
||||
mkdir -p "${LOCKDIR}"
|
||||
|
||||
(
|
||||
# Ensure this is the only instance running
|
||||
flock -n 9 || lock_failed
|
||||
|
|
@ -237,4 +240,4 @@ export BORG_PASSPHRASE
|
|||
fi
|
||||
|
||||
exit_clean 0
|
||||
) 9>${LOCKFILE}
|
||||
) 9>"${LOCKFILE}"
|
||||
|
|
|
|||
|
|
@ -27,9 +27,8 @@ KEEP_YEARLY=5
|
|||
# You can use K, M, G or T binary prefixes (power of 1024), e.g., 5M = 5MiB/s = 5242880 bytes/s.
|
||||
#BWLIMIT=0
|
||||
|
||||
# Change this if you need to have multiple borgwrapper instances running
|
||||
# using different configs.
|
||||
#LOCKFILE="/var/lock/borgwrapper.lock"
|
||||
# Location of borgwrapper lock files
|
||||
#LOCKDIR="/run/lock/borgwrapper"
|
||||
|
||||
# Command to execute before backup, e.g., taking a ZFS snapshot. Must return successfully
|
||||
# for backup to start. POST_BACKUP_CMD is executed even if this fails.
|
||||
|
|
|
|||
Loading…
Reference in New Issue