[CentOS-mirror] Local mirror question

Fri Jan 6 04:21:05 UTC 2006
Vijay Avarachen <vavarachen at gmail.com>

Stephen,
     Thank you very much for your help.  It works pretty good :-) but has a
few glitches.  I read the rsync man pages and according to it the exclusion
list contains files and folder name patterns to be excluded.  The exclusion
works but it still creates symlinks :-(
$ du -s -h *
0       2
0       3
0       3.1
0       3.3
0       3.4
0       3.5
0       4
439M    4.2
0       RPM-GPG-KEY-CentOS-2
4.0K    RPM-GPG-KEY-centos4
0       RPM-GPG-KEY-CentOS-4
4.0K    TIME
4.0K    timestamp.txt

Is there a way to stop it from creating these symlinks that dont' point to
anything. Here is my exclusion list:
/2.1/
/2/
/3.1/
/3.3/
/3.4/
/3.5/
/3.6/
/3/
/4/
/4.0/
/4.1/
/4.3beta/
/HEADER.images/
/RPM-GPG-KEY-CentOS-2/
/RPM-GPG-KEY-CentOS-4/
/build/
/graphics/
/HEADER.html/
/RPM-GPG-KEY-CentOS-3/
/RPM-GPG-KEY-CentOS-4/

#4.2 excludes
/4.2/Readme.txt
/4.2/addons/
/4.2/apt/
/4.2/centosplus/
/4.2/contrib/
/4.2/csgfs/
/4.2/docs/
/4.2/extras/
/4.2/isos/
/4.2/os/
/4.2/testing/
#Only get i386, ia64, x86_64
/4.2/updates/SRPMS/
/4.2/updates/alpha/
/4.2/updates/ppc/
/4.2/updates/s390/
/4.2/updates/s390x/

Thanks,
Vijay Avarachen

On 1/5/06, Stephen Weyland <stephen.weyland at mercuryblue.com.au> wrote:
>
> Vijay Avarachen wrote:
>
> Hello,
>       My environment is using CentOS 4.2 on all workstations and I would
> like to setup a local mirror just for the updates.  I only x86, x86_64 and
> ia64 architectures.  How can I setup a rsync mirror of the updates folder
> for only these architectures?  I am very new to rsync, so please apologize
> if this is a very ignorant question.
>
>  I just finished figuring this out and documenting, so here you go. You
> can probably fine tune it as this is my first attempt.
>
> ### 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, (crontab -e would be better)
>
> 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
>
> Thank you,
> Vijay Avarachen
>
> --
> "Knowledge is the only wealth that grows as you spend it, and diminishes
> as you save it."
> -- ancient Sanskrit saying
>
> ------------------------------
>
> _______________________________________________
> CentOS-mirror mailing list
> CentOS-mirror at centos.orghttp://lists.centos.org/mailman/listinfo/centos-mirror
>
>
>
> --
> Stephen Weyland
>
>
> _______________________________________________
> CentOS-mirror mailing list
> CentOS-mirror at centos.org
> http://lists.centos.org/mailman/listinfo/centos-mirror
>
>
>


--
"Knowledge is the only wealth that grows as you spend it, and diminishes as
you save it."
-- ancient Sanskrit saying
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-mirror/attachments/20060105/02585ca1/attachment-0004.html>