此脚本是通过rsync同步清华大学的yum源,同步到本地
vim /var/ftp/pub/rsync.sh chmod +x /var/ftp/pub/rsync.sh
mkdir -pv /var/ftp/pub/epel/epel/7/ mkdir -pv /var/ftp/pub/epel/centos/7/os/x86_64/ mkdir -pv /var/ftp/pub/epel/centos/7/updates/x86_64/ mkdir -pv /var/ftp/pub/epel/centos/7/extras/x86_64/ mkdir -pv /var/ftp/pub/epel/centos/7/centosplus/x86_64/ #先把相关的目录创建一下然后再来同步脚本,第二次增量同步的时候吧创建目录的命令注释掉就可以了 #epel rsync -avz --exclude-from=/var/ftp/pub/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/epel/7/ /var/ftp/pub/epel/7/ createrepo /var/ftp/pub/epel/7/ #centos7-base rsync -avz --exclude-from=/var/ftp/pub/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/ /var/ftp/pub/centos/7/os/x86_64/ createrepo /var/ftp/pub/centos/7/os/x86_64/ #centos7-updates rsync -avz --exclude-from=/var/ftp/pub/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7/updates/x86_64/ /var/ftp/pub/centos/7/updates/x86_64/ createrepo /var/ftp/pub/centos/7/updates/x86_64/ #centos7-extras rsync -avz --exclude-from=/var/ftp/pub/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7/extras/x86_64/ /var/ftp/pub/centos/7/extras/x86_64/ createrepo /var/ftp/pub/centos/7/extras/x86_64/ #centos7-centosplus rsync -avz --exclude-from=/var/ftp/pub/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7/centosplus/x86_64/ /var/ftp/pub/centos/7/centosplus/x86_64/ createrepo /var/ftp/pub/centos/7/centosplus/x86_64/ #centos7.3.1611-base #rsync -avz --exclude-from=/usr/local/local_mirror/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/os/x86_64/ /var/ftp/pub/centos/7.3.1611/os/x86_64/ #createrepo /var/ftp/pub/centos/7.3.1611/os/x86_64/ #centos7.3.1611-updates #rsync -avz --exclude-from=/usr/local/local_mirror/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/updates/x86_64/ /var/ftp/pub/centos/7.3.1611/updates/x86_64/ #createrepo /var/ftp/pub/centos/7.3.1611/updates/x86_64/ #centos7.3.1611-extras #rsync -avz --exclude-from=/usr/local/local_mirror/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/extras/x86_64/ /var/ftp/pub/centos/7.3.1611/extras/x86_64/ #createrepo /var/ftp/pub/centos/7.3.1611/extras/x86_64/ #centos7.3.1611-centosplus #rsync -avz --exclude-from=/usr/local/local_mirror/exclude.list rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/centosplus/x86_64/ /var/ftp/pub/centos/7.3.1611/centosplus/x86_64/ #createrepo /var/ftp/pub/centos/7.3.1611/centosplus/x86_64/
本脚本中的exclude.list文件内容,把此内容放放到/var/ftp/pub/exclude.list
可以用vim创建
具体命令:vim /var/ftp/pub/exclude.list
详细内容:
SRPMS aarch64 ppc64 ppc64le debug repodata EFI LiveOS images isolinux CentOS_BuildTag EULA GPL RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Testing-7 drpms