搭建yum源并定时同步

一 、安装yum源
1-准备yum目录
cd /data/www/html
createrepo -v ./目录
搭建yum源并定时同步_第1张图片

2-安装服务
yum -y install httpd
3-配置服务
/etc/httpd/conf/httpd.conf
4.配置/etc/yum.repo.d/local.rpeo
搭建yum源并定时同步_第2张图片

二、定时更新yum源
#1. 同步整个源到指定目录
[root@V10SP1-1 pac]# reposync -p /root/pac

2. 同步指定源到指定目录

[root@V10SP1-1 pac]# reposync --repoid=ks10-adv-updates -p /data/www/html

3. 更新同步过的源

[root@V10SP1-1 pac]# reposync -n --repoid=ks10-adv-updates -p /data/www/html
4.设置定时同步任务
0 1 * * 1 reposync -n --repoid=repoSP2base -p /data/www/html
0 3 * * 1 reposync -n --repoid=repoSP2update -p /data/www/html

参考资料
https://blog.csdn.net/qq_34362409/article/details/127789235
https://blog.csdn.net/justlpf/article/details/127382277

你可能感兴趣的:(服务器,linux,apache)