sync.sh: Fix LOCKDIR (was cgommon since .syncrc usage)
This commit is contained in:
@@ -509,10 +509,11 @@ parse_opts() {
|
|||||||
fi
|
fi
|
||||||
# shellcheck source=sync-conf-example.sh
|
# shellcheck source=sync-conf-example.sh
|
||||||
source "$CONFIG"
|
source "$CONFIG"
|
||||||
LOCKDIR="/tmp/$CMDNAME-$HOSTNAME-${CONFIG##*/}.lock"
|
|
||||||
|
|
||||||
# _backup_dir takes precedence on SOURCEDIR (useless ?)
|
# _backup_dir takes precedence on SOURCEDIR (useless ?)
|
||||||
SOURCEDIR=${_backup_dir:-$SOURCEDIR}
|
SOURCEDIR=${_backup_dir:-$SOURCEDIR}
|
||||||
|
|
||||||
|
LOCKDIR="/tmp/$CMDNAME-$HOSTNAME${SOURCEDIR////-}.lock"
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_opts "$@"
|
parse_opts "$@"
|
||||||
@@ -558,13 +559,13 @@ TODO=()
|
|||||||
[[ $YEARLY = y ]] && (( NYEARS > 0 )) && TODO+=(yearly "$NYEARS")
|
[[ $YEARLY = y ]] && (( NYEARS > 0 )) && TODO+=(yearly "$NYEARS")
|
||||||
|
|
||||||
log -l -t "Starting %s" "$CMDNAME"
|
log -l -t "Starting %s" "$CMDNAME"
|
||||||
log "Bash version: %s.%s.%s" \
|
log "Bash version: %s.%s.%s" "${BASH_VERSINFO[@]:0:3}"
|
||||||
"${BASH_VERSINFO[0]}" "${BASH_VERSINFO[1]}" "${BASH_VERSINFO[2]}"
|
|
||||||
log "Hostname: %s" "$HOSTNAME"
|
log "Hostname: %s" "$HOSTNAME"
|
||||||
log "Operating System: %s on %s" "$(uname -sr)" "$(uname -m)"
|
log "Operating System: %s on %s" "$(uname -sr)" "$(uname -m)"
|
||||||
log "Config : %s\n" "$CONFIG"
|
log "Config : %s\n" "$CONFIG"
|
||||||
log "Src dir: %s" "$SOURCEDIR"
|
log "Src dir: %s" "$SOURCEDIR"
|
||||||
log "Dst dir: %s" "$SERVER:$DESTDIR"
|
log "Dst dir: %s" "$SERVER:$DESTDIR"
|
||||||
|
log "Lock dir: %s" "$LOCKDIR"
|
||||||
log "Actions: %s" "${TODO[*]}"
|
log "Actions: %s" "${TODO[*]}"
|
||||||
if (( ${#RSYNCOPTS[@]} )); then
|
if (( ${#RSYNCOPTS[@]} )); then
|
||||||
log -n "Rsync additional options (%d): " "${#RSYNCOPTS[@]}"
|
log -n "Rsync additional options (%d): " "${#RSYNCOPTS[@]}"
|
||||||
|
Reference in New Issue
Block a user