Verified Commit 73bf287a authored by Jelle van der Waa's avatar Jelle van der Waa 🚧

Lock before deleting files

As reported in FS#69614 the lock should be before the delete for when
another sync job is running rsync can't move the files as they are
removed.
parent f32f3995
Pipeline #5254 passed with stage
in 50 seconds
......@@ -59,12 +59,12 @@ lastupdate_url=''
[ ! -d "${target}" ] && mkdir -p "${target}"
[ ! -d "${tmp}" ] && mkdir -p "${tmp}"
# Cleanup any temporary files from old run that might remain.
find "${target}" -name '.~tmp~' -exec rm -r {} +
exec 9>"${lock}"
flock -n 9 || exit
# Cleanup any temporary files from old run that might remain.
find "${target}" -name '.~tmp~' -exec rm -r {} +
rsync_cmd() {
local -a cmd=(rsync -rtlH --safe-links --delete-after ${VERBOSE} "--timeout=600" "--contimeout=60" -p \
--delay-updates --no-motd "--temp-dir=${tmp}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment