Thanks,
Vijay Avarachen
On 1/5/06, Stephen
Weyland <stephen.weyland@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@centos.org
http://lists.centos.org/mailman/listinfo/centos-mirror
--
Stephen Weyland
_______________________________________________
CentOS-mirror mailing list
CentOS-mirror@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
_______________________________________________
CentOS-mirror mailing list
CentOS-mirror@centos.org
http://lists.centos.org/mailman/listinfo/centos-mirror