Skip to content
Snippets Groups Projects
Verified Commit 73bf287a authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment