[CentOS] auto-creating a local yum cache?

John R Pierce pierce at hogranch.com
Mon Dec 12 21:58:38 UTC 2011


On 12/12/11 12:49 PM, Alan McKay wrote:
> I know I can create my own repository and then point them at it - but that
> is difficult here because rsync is blocked (ggrrrrrr...)

I use this script to create a full mirror of a repository, using LFTP 
rather than RSYNC...


#!/usr/bin/sh
/usr/bin/lftp -c 'open ftp://mirrors.kernel.org && lcd /export/mirror && 
mirror --continue --verbose=1 -x ia64 -x s390 -x s390x -x alpha -x SRPMS 
centos'

I run this once a week via crontab (and manually if I know there are 
important updates).

This creates /export/mirror/centos which I share locally as both http 
and nfs, it includes all versions and flavors except itanium, s390, 
alpha, and the SRPMS.  specifically it DOES include all the ISO's (I nfs 
mount those on my vmware servers for installs...).

lftp has been far more robust than rsync ever was.

I also configure my local centos installs with 
/etc/yum.repos.d/CentOS-Base.repo.conf as

baseurl=http://mirror.myserver.domain.com/mirror/centos/$releasever/os/$basearch/

(for all categories in said .conf file)


-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast




More information about the CentOS mailing list