Re: report to ftpsync a patch to avoid the use the lockfile programm
Simon Paillard (simon.paillard@resel.enst-bretagne.fr) wrote on 15 November 2008 02:18:
>Since the lockfile programm used in the new ftpsync requires the
>installation of procmail package on debian, and might not be available
>on some other platforms, here is a tiny modification to avoid this
>dependancy.
>
>--
>Simon Paillard
>diff --git a/bin/ftpsync b/bin/ftpsync
>index ec06c7c..f827e6a 100755
>--- a/bin/ftpsync
>+++ b/bin/ftpsync
>@@ -233,8 +233,6 @@ FULLLOGS=${FULLLOGS:-"false"}
>
> # How to rotate our log
> SAVELOG=${SAVELOG:-"savelog -t -c 14"}
>-# Lockfile program
>-LOCKFILE=${LOCKFILE:-"lockfile"}
>
> # Our lockfile
> LOCK=${LOCK:-"${TO}/Archive-Update-in-Progress-${MIRRORNAME}"}
>@@ -338,7 +336,7 @@ mkdir -p "${TO}/project/trace"
> touch "${UPDATEREQUIRED}"
>
> # Check to see if another sync is in progress
>-if ${LOCKFILE} -! -l 43200 -r 0 "${LOCK}"; then
>+if [ "`find ${LOCK} -maxdepth 1 -cmin -720`" != ""]; then
> error "Unable to start rsync, lock file still exists"
> exit 1
> fi
I think it's missing a
else
touch $LOCK
because lockfile creates the lock if it doesn't exist.
Reply to: