From 0e74baf1add9e7fea3d07e1c79af88831fc5d5f3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 23 Jan 2013 23:07:19 +0100 Subject: syncrepo: check repo_mtime file Signed-off-by: Florian Pritz --- syncrepo | 5 +++++ 1 file changed, 5 insertions(+) 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}" \ -- cgit v1.2.3-24-g4f1b