summaryrefslogtreecommitdiffstats
path: root/syncrepo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'syncrepo.sh')
-rwxr-xr-xsyncrepo.sh8
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