From 595cc86748916db27abe869087157357164ee884 Mon Sep 17 00:00:00 2001 From: Zane Williams Date: Tue, 23 Nov 2021 17:53:49 +0100 Subject: [PATCH] Exit cleanly if file list is unchanged at mirrorsync run init. --- mirror/mirrorsync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirror/mirrorsync.sh b/mirror/mirrorsync.sh index 31db4c3..55f8a39 100644 --- a/mirror/mirrorsync.sh +++ b/mirror/mirrorsync.sh @@ -55,12 +55,12 @@ lockfile="$0.lockfile" logfile="$0.log" # Check if the filelistfile has changed on upstream mirror -# and exit if it is still the same +# and exit cleanly if it is still the same checkresult=$(rsync --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}") if [[ -z "$checkresult" ]]; then printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1 logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged." - exit 1 + exit 0 fi # Check for existing lockfile to avoid multiple simultaneously running syncs