rsync linux yum,rsync同步公网yum源搭建本地yum仓库

镜像同步公网yum源上游yum源必须要支持rsync协议,否则不能使用rsync进行同步。

centos源:rsync://rsync.mirrors.ustc.edu.cn/centos/

epel源:rsync://rsync.mirrors.ustc.edu.cn/epel/

同步命令:

# rsync -vrt --bwlimit=3000 --exclude=debug/ rsync://rsync.mirrors.ustc.edu.cn/epel/7/x86_64/ /data/mirrors/centos/epel7/x86_64/

_______________________________________________________________

| University of Science and Technology of China |

| Open Source Mirror (mirrors.ustc.edu.cn) |

|===============================================================|

| |

| Debian primary mirror in China mainland (ftp.cn.debian.org), |

| also mirroring a great many OSS projects & Linux distros. |

| |

| Currently we don't limit speed. To prevent overload, Each IP |

| is only allowed to start upto 2 concurrent rsync connections. |

| |

| This site also provides http/https/ftp access. |

| |

| Supported by USTC Network Information Center |

| and USTC Linux User Group (http://lug.ustc.edu.cn/). |

| |

| Sync Status: https://mirrors.ustc.edu.cn/status/ |

| News: https://servers.ustclug.org/ |

| Contact: lug@ustc.edu.cn |

| |

|_______________________________________________________________|

receiving incremental file list

./

x86_64/

x86_64/0/

x86_64/0/0ad-0.0.22-1.el7.x86_64.rpm

x86_64/0/0ad-data-0.0.22-1.el7.noarch.rpm

...

# rsync -vrt rsync://mirrors.ustc.edu.cn/centos/7/os/x86_64/ /data/mirrors/centos/7/os/x86_64/

# rsync -vrt rsync://mirrors.ustc.edu.cn/centos/7/extras/x86_64/ /data/mirrors/centos/7/extras/x86_64/

# rsync -vrt rsync://mirrors.ustc.edu.cn/centos/7/updates/x86_64/ /data/mirrors/centos/7/updates/x86_64/

# rsync -vrt --bwlimit=20000 rsync://rsync.mirrors.ustc.edu.cn/centos/6.9/ /data/mirrors/centos/6.9/

# rsync -vrt --bwlimit=20000 --exclude=debug/ rsync://rsync.mirrors.ustc.edu.cn/epel/6/x86_64/ /data/mirrors/centos/epel6/x86_64/

配置apache发布镜像目录,当然也可以用nginx或者其他web服务器。

# vim /etc/httpd/conf/httpd.conf

# 注释掉这一段

#

# AllowOverride none

# Require all denied

#

# 添加这一段

Alias /centos "/data/mirrors/centos/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

# /etc/init.d/httpd reload

最后,配置repo就可以使用了。

[base]

name=CentOS-$releasever - Base

baseurl=http://10.100.10.89/centos/$releasever/os/$basearch/

enable=1

gpgcheck=0

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=http://10.100.10.89/centos/$releasever/updates/$basearch/

enable=1

gpgcheck=0

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=http://10.100.10.89/centos/$releasever/extras/$basearch/

enable=1

gpgcheck=0

[epel]

name=Extra Packages for Enterprise Linux 7 - $basearch

baseurl=http://10.100.10.89/centos/epel/7/$basearch

enabled=1

gpgcheck=0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值