#!/bin/sh # # pull-mirror # John Simpson 2007-12-02 # ############################################################################### # # Copyright (C) 2007 John Simpson. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # or visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html # ############################################################################### SERVER="rsync://mirrors.kernel.org/centos" LOCAL="/pub/centos" LIST_REL="5.0" LIST_ARCH="i386" LIST_REPO="os updates" if [ ! -d $LOCAL ] then mkdir -m 755 $LOCAL fi rsync -qirltS --delete \ $SERVER/RPM-GPG-KEY-CentOS-5 \ $LOCAL/ for rel in $LIST_REL do if [ ! -d $LOCAL/$rel ] then mkdir -m 755 $LOCAL/$rel fi for repo in $LIST_REPO do if [ ! -d $LOCAL/$rel/$repo ] then mkdir -m 755 $LOCAL/$rel/$repo fi for arch in $LIST_ARCH do if [ ! -d $LOCAL/$rel/$repo/$arch ] then mkdir -m 755 $LOCAL/$rel/$repo/$arch fi rsync -qirltS --delete --exclude=debug/ \ $SERVER/$rel/$repo/$arch/ \ $LOCAL/$rel/$repo/$arch/ done done done chmod -R go=u-w $LOCAL chown -R 0:0 $LOCAL