[CentOS] Mirroring centos.org

Mon Jan 29 15:48:49 UTC 2018
Tony Mountifield <tony at softins.co.uk>

In article <CANZsmmM6C_F+NuPdjd+mGDEXaJVcfc1bdhpWdESSbC2CR7Dz3g at mail.gmail.com>,
Felipe Westfields <felipe.westfields at gmail.com> wrote:
> Hello,
> I would like to mirror the centos.org repository for an offline network. I
> don't need the ISO images, don't need any i386 stuff, and I think I
> probably don't need any of the source code rpms either. Most of the clients
> are CentOS 6.x, so I don't want to download the CentOS 7.x tree yet either
> (that will come soon, but separately from this one).
> I tried using this command, but it still downloaded all of the i386
> sub-folders anyway, and I got about 15 gigs or so of stuff I didn't want.
> wget -m -np --exclude-directories=i386 http://mirror.centos.org/centos-6/6/
> I'm guessing there's a formatting mistake of some kind in this command. Do
> you need to specify the excluded sub-folders relative to the top directory
> you're downloading from? i.e. rather than "i386", you'd need to specify
> "/centos-6/6/updates/i386/"?

Don't use wget at all. Use rsync instead, from a mirror that supports it.
Here is what I use (in a nightly cron):

# cd /myrepo
# rsync -rltHvz --delete rsync://rsync.mirrorservice.org/mirror.centos.org/6/os/i386/ centos6/os/i386/
# rsync -rltHvz --delete rsync://rsync.mirrorservice.org/mirror.centos.org/6/updates/i386/ centos6/updates/i386/
# rsync -rltHvz --delete rsync://rsync.mirrorservice.org/mirror.centos.org/6/os/x86_64/ centos6/os/x86_64/
# rsync -rltHvz --delete rsync://rsync.mirrorservice.org/mirror.centos.org/6/updates/x86_64/ centos6/updates/x86_64/

Omit the ones you don't want.

There are other ideas listed at https://wiki.centos.org/HowTos/CreateLocalMirror

Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org