[mirror-admin] rsync filtering to reduce master mirror load
Ján ONDREJ (SAL)
ondrejj at salstar.sk
Fri Apr 10 03:27:13 EDT 2009
> this is indeed an improvement, thanks. However, the timestamp
> calculation isn't quite right unless your system clock is UTC. Care
> to finish that aspect? :-)
Thank you for confirmation. Can you check, if it's better this way?
LAST_UPDATE=~/.fedora.update
# mirrormanager_exclude /tmp/rh_exclude /linux/updates
mirrormanager_exclude() {
if [ -f "$LAST_UPDATE" ]; then
t0s="`TZ=UTC stat -c %y $LAST_UPDATE | sed 's/ .0000$//g'`"
t0=`date -d "$t0s" +%s`
else
t0=0
fi
touch "$LAST_UPDATE"
URL="https://admin.fedoraproject.org/mirrormanager/rsyncFilter"
wget -q -O "$1" \
"$URL?categories=Fedora%20Linux&since=$t0&stripprefix=pub/fedora$2"
}
It's curious, that using:
TZ=UTC stat -c %Y $LAST_UPDATE
returns same number as without TZ=UTC. May be it will be better to accept
since in any format with timezone anc convert it in rsyncFilter script, for
example using:
if not since.isdigit():
since = time.mktime(time.strptime(since, "%Y-%m-%d %H:%M:%S.000000000 +0000"))
%z does not work in my python.
SAL
--
More information about the Mirror-admin
mailing list