diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-07-29 16:51:34 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-07-29 16:51:34 +0200 |
commit | d3b841df92c269b092ba68bad6ab75efa024609e (patch) | |
tree | 37753bd8569c226ec93fc51576614b61c7a1b3b0 | |
parent | 6f8330ae4e7707fbf36e231197d4998cc8a96a44 (diff) | |
download | bin-d3b841df92c269b092ba68bad6ab75efa024609e.tar.gz bin-d3b841df92c269b092ba68bad6ab75efa024609e.tar.xz |
syncrepo.sh: Merge changes from script deployed on arch servers
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | syncrepo.sh | 8 |
1 files 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 |