[CentOS-mirror] Mirror setup (also new mirror announce)

Mon Feb 27 22:29:44 UTC 2006
Stephen Weyland <stephen.weyland at mercuryblue.com.au>

This is a howto I created for myself, my goal was the same as yours. 
This has been previously posted.

### How to use rsync to create a local mirror of the insallation files 
for CentOS, of course this could be used for anything else with 
modifications.
### We are going to create 2 files and edit a 3rd
### 1- Create  a directory to store some files in.
### 2- A script to run rsync --- "update.sh"
### 3- An exclusion list so we don't download a bunch of stuff we don't 
want --- "rsync-exclude.list"
### 4- We need to schedule the update to run by modifying --- /etc/crontab

1- Create a directory to store the files "update.sh" and 
"rsync-exclude.list"
mkdir /opt/mirror

2- Create "update.sh" script to run rsync
# See a list of mirrors at 
http://www.centos.org/modules/tinycontent/index.php?id=13
# --delete means delete files locally that no longer exist on the mirror
vi /opt/mirror/update.sh
rsync -aqzH --exclude-from=/opt/mirror/rsync-exclude.list --delete 
rsync.planetmirror.com::centos /var/ftp/pub/centos/
# make it executable
chmod 700 /opt/mirror/update.sh

3- Create an exclude list
vi /opt/mirror/rsync-exclude.list
# add a list of the files you want to be excluded in the rsync process
# files with a slash at the beginning are referenced to the root of the 
rsync directory you connected to.
# in this case rsync.planetmirror.com/centos (the ::centos above is the 
/centos here)
# files with a trailing slash indicate any directory with that name 
anywhere. e.g "apt/" will skip any directory in any sub-tree named apt

/2.1/
/2/
/3.1/
/3.3/
/3.4/
/3.5/
/3.6/
/3/
# The following need to be excluded from /4/
apt/
docs/
isos/
# The following need to be excluded from all directories they are 
present in, like /4/os/ and /4/updates/  ...  We only want the i386 
directory.
SRPMS/
alpha/
ia64/
ppc/
s390/
s390x/
x86_64/



4- Add a line to /etc/crontab to run the job once a day or once a week 
or whenever, the following shows run on the 1st minute, 1st hour, Sunday

1  1  * * sun root /opt/mirror/update.sh

Stephen Weyland
Systems Administrator
Mercury Blue
8398-1210



William Dunn wrote:

> I would suggest lots of --exclude directives in your rsync script; for 
> instance,
>
> rsync -aqzH --partial --delete --exclude '/3.*' --exclude '/2.*' 
> us-msync.centos.org::CentOS /foo/bar/pub/CentOS
>
> or, barring that,
>
> rsync -blah -blah --exclude '/2' --exclude '/2.1' --exclude '/3' 
> --exclude '/3.1' --exclude and so forth
>
> I mean, I'm a n00b, and there's probably a better way to do it; but 
> that should work (crosses fingers).
>
>
> I'd also like to take this opportunity to introduce myself.  My name's 
> Will, and I'm the Linux admin for the Computer Science Department at 
> Virginia Tech.  I've set up a publicly available CentOS mirror at 
> http://mirror.cs.vt.edu/pub/CentOS and 
> ftp://mirror.cs.vt.edu/pub/CentOS/ - At some point, there will be an 
> entry page at http://mirror.cs.vt.edu/ but for the moment... there's not.
> I sync from us-msync once or twice a day, and I am planning on upping 
> that to 4 times soon.  My upload isn't capped (yet); I'm waiting to 
> see how much interest there is in the mirror before I decide that it 
> needs to be capped.  We're tied into the University's OC48; but I am 
> sharing with 20,000 students and faculty members.
>
>
> ~Will
> CS Technical Staff
> Virginia Tech
>
>
>
> weeteck at cnixal.com wrote:
>
>> Hi all,
>>
>> I'm on my way to mirror CentOS but only intend to mirror CentOS 4. Any
>> help on how to rsync only the particular version?
>>
>>
>> Cheers
>>
>> Teck
>>
>> _______________________________________________
>> CentOS-mirror mailing list
>> CentOS-mirror at centos.org
>> http://lists.centos.org/mailman/listinfo/centos-mirror
>
> _______________________________________________
> CentOS-mirror mailing list
> CentOS-mirror at centos.org
> http://lists.centos.org/mailman/listinfo/centos-mirror