<div dir="ltr"><div><div><div>Hi adrian, I suggest you to publish it in GitHub <br></div>So that a third party can develop it or find out this <br><br></div>Sincerely, <br></div>Muhammed<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 2:20 PM, Adrian Reber <span dir="ltr"><<a href="mailto:adrian@lisas.de" target="_blank">adrian@lisas.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am using dl.fedoraproject.org::fedora-buffet0/ to mirror Fedora and<br>
a rsync run which downloads no new files still needs around 2500 seconds<br>
to check if there have been any changes.<br>
<br>
To avoid running rsync without actually downloading anything I have<br>
written a script which queries Fedora's message bus to see if there<br>
have been changes or not.<br>
<br>
The script is available at:<br>
<br>
<a href="https://fedorahosted.org/fedora-infrastructure/attachment/ticket/4539/last-sync" target="_blank">https://fedorahosted.org/fedora-infrastructure/attachment/ticket/4539/last-sync</a><br>
<br>
and details about its usage are right now only documented in this ticket:<br>
<br>
<a href="https://fedorahosted.org/fedora-infrastructure/ticket/4539" target="_blank">https://fedorahosted.org/fedora-infrastructure/ticket/4539</a><br>
<br>
As I am recording for each mirror the starttime, endtime and status I<br>
can avoid running rsync if nothing has actually changed. I have added<br>
the following lines to my mirror script:<br>
<br>
# check if mirror needs to be updated<br>
CURDATE=`date +%s`<br>
LASTRUN=$( # some sql command to query the last successful run )<br>
DELTA=`echo ${CURDATE}-${LASTRUN} | bc`<br>
<br>
/path/to/last-sync -d ${DELTA} -q<br>
<br>
if [ "$?" -ne "0" ]; then<br>
# no changes on the master mirror<br>
# abort<br>
exit 0<br>
fi<br>
<br>
As this might be helpful for other mirrors I am posting it here.<br>
<span class="HOEnZb"><font color="#888888"><br>
Adrian<br>
</font></span><br>--<br></blockquote></div><br></div>