update lockfile

This commit is contained in:
Julian Schäfer 2024-02-26 10:04:14 +01:00
parent 3b3e74b0a2
commit ea2d11c48b

View File

@ -2,6 +2,15 @@
# backup-zfs: use zfs send/recv to push/pull snapshots - New does not run twice # backup-zfs: use zfs send/recv to push/pull snapshots - New does not run twice
prog="$(basename "$0")" prog="$(basename "$0")"
lockfilecheck="${!#}"
# Überprüfen, ob die Variable ".lock" enthält
if [[ $lockfilecheck = *'.lock' ]]; then
custom_lockfile="${lockfilecheck}"
else
custom_lockfile="bashclub-zfs.lock"
fi
usage() { usage() {
cat >&2 <<-EOF cat >&2 <<-EOF
usage: $prog [-hvq] [-t tag] [-k keep] [-d dateopts] src dest usage: $prog [-hvq] [-t tag] [-k keep] [-d dateopts] src dest
@ -281,4 +290,4 @@ ZFS() {
ZFS "$srchost" destroy -r $srcfs@$snap ZFS "$srchost" destroy -r $srcfs@$snap
done done
) 9>/var/lock/bashclub-zfs.lock ) 9>/var/lock/$custom_lockfile