From d3b841df92c269b092ba68bad6ab75efa024609e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 29 Jul 2017 16:51:34 +0200 Subject: syncrepo.sh: Merge changes from script deployed on arch servers Signed-off-by: Florian Pritz --- syncrepo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syncrepo.sh b/syncrepo.sh index 0481ea5..8f62d7a 100755 --- a/syncrepo.sh +++ b/syncrepo.sh @@ -25,15 +25,15 @@ lastupdate_url="http://rsync.archlinux.org/lastupdate" exec 9>"${lock}" flock -n 9 || exit -if ! stty &>/dev/null; then - QUIET="-q" +if stty &>/dev/null; then + VERBOSE="-h -v --progress" fi -rsync_cmd=(rsync -rtlvH --safe-links --delete-after --progress -h ${QUIET} "--timeout=600" "--contimeout=60" -p \ +rsync_cmd=(rsync -rtlH --safe-links --delete-after ${VERBOSE} "--timeout=600" "--contimeout=60" -p \ --delay-updates --no-motd "--bwlimit=$bwlimit" "--temp-dir=${tmp}") # if we are called without a tty (cronjob) only run when there are changes -if ! tty -s && diff -b <(curl -s "$lastupdate_url") "$target/lastupdate" >/dev/null; then +if ! tty -s && [[ -f "$target/lastupdate" ]] && diff -b <(curl -s "$lastupdate_url") "$target/lastupdate" >/dev/null; then # keep lastsync file in sync for statistics generated by the Arch Linux website "${rsync_cmd[@]}" "$source/lastsync" "$target/lastsync" exit 0 -- cgit v1.2.3-24-g4f1b