summaryrefslogtreecommitdiffstats
path: root/syncrepo
diff options
context:
space:
mode:
Diffstat (limited to 'syncrepo')
-rwxr-xr-xsyncrepo5
1 files changed, 5 insertions, 0 deletions
diff --git a/syncrepo b/syncrepo
index 7d249da..ddc2cff 100755
--- a/syncrepo
+++ b/syncrepo
@@ -5,6 +5,7 @@ target="${home}/repo"
tmp="${home}/tmp"
lock='/tmp/mirrorsync.lck'
source='pkgbuild.com::packages/'
+repo_mtime_url="http://rsync.archlinux.org/repo_mtime"
[ ! -d "${target}" ] && mkdir -p "${target}"
[ ! -d "${tmp}" ] && mkdir -p "${tmp}"
@@ -12,6 +13,10 @@ source='pkgbuild.com::packages/'
touch "${lock}"
trap "rm -f '${lock}'" EXIT INT TERM
+if diff -b <(curl -s "$repo_mtime_url") "$target/repo_mtime" >/dev/null; then
+ exit 0
+fi
+
rsync -rtlvH --safe-links --delete-after --progress -h \
--delay-updates --no-motd --bwlimit=1000 \
--temp-dir="${tmp}" \