mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-22 05:01:25 +00:00
Exit cleanly if file list is unchanged at mirrorsync run init.
This commit is contained in:
parent
24eb7740e2
commit
595cc86748
@ -55,12 +55,12 @@ lockfile="$0.lockfile"
|
|||||||
logfile="$0.log"
|
logfile="$0.log"
|
||||||
|
|
||||||
# Check if the filelistfile has changed on upstream mirror
|
# 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}")
|
checkresult=$(rsync --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}")
|
||||||
if [[ -z "$checkresult" ]]; then
|
if [[ -z "$checkresult" ]]; then
|
||||||
printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1
|
printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1
|
||||||
logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged."
|
logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged."
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for existing lockfile to avoid multiple simultaneously running syncs
|
# Check for existing lockfile to avoid multiple simultaneously running syncs
|
||||||
|
Loading…
Reference in New Issue
Block a user