[CentOS-mirror] Reposync or rsync - What's the best for creating a local mirror

Wed May 23 06:22:22 UTC 2018
Christopher Hawker <christopher at colonet.com.au>

Hello Joerg,

I would say to use rsync, but it appears as though Anssi has beat me to it 😝, and as it's the simplest method to sync. Here's the contents from my Crontab file:

18 0,6,12,18 * * * rsync -aqzH msync.centos.org::CentOS /mirror/centos >/dev/null 2>&1
44 3,9,15,21 * * * rsync -aqzH msync.centos.org::altarch /mirror/centos-altarch >/dev/null 2>&1

Two lines, and done! Our CentOS mirror updates at the 18 minutes past midnight, 6am, 12pm and 6pm. AltArch updates at 44 minutes past 3am, 9am, 3pm and 9pm. The reason I select random minutes is so that our mirror is not affected by heavy loads and reduces our load on the master sync nodes.

HTH,
Christopher Hawker.


________________________________
From: CentOS-mirror <centos-mirror-bounces at centos.org> on behalf of Anssi Johansson <avij at centosproject.org>
Sent: Wednesday, 23 May 2018 4:16:57 PM
To: centos-mirror at centos.org
Subject: Re: [CentOS-mirror] Reposync or rsync - What's the best for creating a local mirror

Jörg Kastning kirjoitti 23.5.2018 klo 8.59:
> Hi all,
>
> I'm going to create a local mirror using information found on:
> https://wiki.centos.org/HowTos/CreateLocalMirror
>
>  From the I know that I could use reposync or an rsync script to sync my
> mirror. But I'm not sure what the pros and cons of either method are.
>
> As far as I know I have to choose one specific mirror nearby when using
> rsync. If this mirror is not available I have to change my script to use
> another one.
>
> Using reposync I guess it would choose the fastest mirror from the
> configured yum repos of my installation.
>
> Please correct me, if I'm wrong in my assumptions.
>
> Maybe in the future I would like to provide a public mirror. Is there
> any preferred sync method for this scenario?

For public mirrors you should use rsync. reposync will not sync non-rpm
files, such as .iso images. Using reposync would also break the signed
metadata (repomd.xml.asc), and arranging the mirror layout would be
unnecessarily difficult with reposync. Reposync doesn't know about hard
links either. So the tool to use for public mirrors is rsync.

For a private mirror either one will work, but I prefer using rsync for
my own private mirror due to the layout matching what is on other
mirrors. The upstream mirrors won't change that often, so I don't think
you would need to change that URL that often. And if you're planning to
provide a public mirror at some point, I'd suggest going straight to
rsync and skipping reposync.

If you don't need all the files from the mirrors, you can --exclude
them, like --exclude '*/cloud/*'

You may want to use -v --dry-run first to see which files would get
transferred.
_______________________________________________
CentOS-mirror mailing list
CentOS-mirror at centos.org
https://lists.centos.org/mailman/listinfo/centos-mirror
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-mirror/attachments/20180523/a9073c64/attachment-0006.html>