[root@op-yum01]#
cat /home/work/yumdata/rsync-reposync.
sh
#!/bin/
bash
#Purpose: Sync centos7 repos via rsync behind proxy
#Makesure rsync port 873 is allowed outbound on the squid proxy
#export RSYNC_PROXY=
172.18.
6.5:
80
export RSYNC_PROXY=proxy.intra.yiducloud.cn:
80
#create directory structure
mkdir -p /home/work/yumdata/www/centos/
7/
{os,updates,extras}
mkdir -p /home/work/yumdata/www/saltstack/
rhel
#Update Base Repo
rsync -avP rsync:
//rsync.mirrors.ustc.edu.cn/centos/7/os/ /home/work/yumdata/www/centos/7/os/
#Update Updates Repo
rsync -avP rsync:
//rsync.mirrors.ustc.edu.cn/centos/7/updates/ /home/work/yumdata/www/centos/7/updates/
#Update Extras Repo
rsync -avP rsync:
//rsync.mirrors.ustc.edu.cn/centos/7/extras/ /home/work/yumdata/www/centos/7/extras/
#Update epel Repo
rsync -avP rsync:
//rsync.mirrors.ustc.edu.cn/epel/7/x86_64/ /home/work/yumdata/www/centos/7/epel/x86_64/
#Update Saltstack Repo
rsync -vaH --exclude
"*5/*" --exclude
"*6/*" --numeric-ids --delete --delete-after --delay-updates rsync:
//repo.saltstack.com/saltstack_pkgrepo_rhel/redhat/ /home/work/yumdata/www/saltstack/rhel/redhat/
转载于:https://www.cnblogs.com/tengfei520/p/8177487.html
相关资源:repo 仓库建设方法