mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-25 06:31:24 +00:00
Update mirrorsync.sh
Removed calling rsync by explicit path
This commit is contained in:
parent
cddbf9fc58
commit
343a2269b2
@ -32,7 +32,6 @@
|
||||
#
|
||||
|
||||
|
||||
rsync="/usr/bin/rsync"
|
||||
# You can change v to q if you do not want detailed logging
|
||||
opts=(-vrlptDSH --exclude="*.~tmp~" --delete-delay --delay-updates)
|
||||
|
||||
@ -55,7 +54,7 @@ logfile="$0.log"
|
||||
|
||||
# Check if the filelistfile has changed on upstream mirror
|
||||
# and exit 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
|
||||
printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1
|
||||
logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged."
|
||||
@ -78,8 +77,7 @@ fi
|
||||
printf '%s\n' "$$" > "$lockfile"
|
||||
printf "Started update at %(%c)T\n" -1 >> "$logfile" 2>&1
|
||||
logger -t rsync "Updating ${mirrormodule}"
|
||||
${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1
|
||||
rsync "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1
|
||||
logger -t rsync "Finished updating ${mirrormodule}"
|
||||
printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1
|
||||
rm -f $lockfile
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user