mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-12-28 20:50:54 +00:00
Update mirrorsync.sh
Removed calling rsync by explicit path
This commit is contained in:
parent
cddbf9fc58
commit
343a2269b2
1 changed files with 2 additions and 4 deletions
|
@ -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 a new issue