[mirror-admin] Only run rsync if something has actually changed

Muhammed Salehi salehi1994 at gmail.com
Tue Sep 30 07:01:37 EDT 2014


Hi adrian, I suggest you to publish it in GitHub
So that a third party can develop it or find out this

Sincerely,
Muhammed

On Tue, Sep 30, 2014 at 2:20 PM, Adrian Reber <adrian at lisas.de> wrote:

> I am using dl.fedoraproject.org::fedora-buffet0/ to mirror Fedora and
> a rsync run which downloads no new files still needs around 2500 seconds
> to check if there have been any changes.
>
> To avoid running rsync without actually downloading anything I have
> written a script which queries Fedora's message bus to see if there
> have been changes or not.
>
> The script is available at:
>
>
> https://fedorahosted.org/fedora-infrastructure/attachment/ticket/4539/last-sync
>
> and details about its usage are right now only documented in this ticket:
>
> https://fedorahosted.org/fedora-infrastructure/ticket/4539
>
> As I am recording for each mirror the starttime, endtime and status I
> can avoid running rsync if nothing has actually changed. I have added
> the following lines to my mirror script:
>
> # check if mirror needs to be updated
> CURDATE=`date +%s`
> LASTRUN=$( # some sql command to query the last successful run )
> DELTA=`echo ${CURDATE}-${LASTRUN} | bc`
>
> /path/to/last-sync -d ${DELTA} -q
>
> if [ "$?" -ne "0" ]; then
>         # no changes on the master mirror
>         # abort
>         exit 0
> fi
>
> As this might be helpful for other mirrors I am posting it here.
>
>                 Adrian
>
> --
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/mirror-admin/attachments/20140930/6d10527f/attachment.html>
-------------- next part --------------
--


More information about the Mirror-admin mailing list