1. 创建同步文件

参考清华的Centos源,配置同步文件。https://mirrors.tuna.tsinghua.edu.cn/help/centos/

[root@localhost centos]# cat centos-repo.conf
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2. 同步源到本地文件夹(此文件夹需要结合nginx 配置成网络可访问的文件服务器:nginx location 配置详解

[root@localhost centos]# reposync -c centos-repo.conf 

3. 创建 repo 

cd $i && createrepo .

4. 定时同步

crontab -e
* * * /usr/bin/reposync -np /home/centos

5. 重新配置镜像地址

本方法的一个例子,可以参考lustre文件系统安装

参考链接:

https://www.cnblogs.com/juandx/p/6136621.html

https://blog.csdn.net/u012402276/article/details/53158682

https://blog.csdn.net/moyuanbomo/article/details/81667006

可参考:可选配置文件

/usr/bin/reposync -np /home/centos -c centos-repo.conf

最新文章

  1. [LeetCode] Gray Code 格雷码
  2. Linux 性能优化工具 perf top
  3. iOS开发——高级技术&GameCenter服务
  4. C#的控制台程序输出
  5. Xcode-项目模板修改
  6. 《你不常用的c#之一》:略谈unsafe
  7. IOS性能调优系列:使用Instruments动态分析内存泄漏
  8. 暴力求解——Equivalent Strings
  9. scheme递归
  10. 恢复gvim的ctl+v可视模式设置
  11. python----mysql链接汉字编码的问题
  12. Nim 博弈和 sg 函数
  13. matplotlib-形状
  14. secondPage
  15. day11 第一类对象 闭包 迭代器
  16. Linux内核分析 NO.3
  17. mysql进程文件
  18. 接口测试maven管理
  19. Float浮点数的使用和条件
  20. 【BZOJ2743】[HEOI2012]采花 离线+树状数组

热门文章

  1. JAVA微信企业付款到零钱(十分钟搞定),附完整DEMO下载
  2. Cesium专栏-裁剪效果(基于3dtiles模型,附源码下载)
  3. 解决MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.问题
  4. AudioRecord 录制播放PCM音频
  5. angluarjs实现过滤并替换关键字
  6. numpy中array和matrix的区别
  7. crossover mac如何使用?crossover mac使用教程
  8. 【攻防世界】高手进阶 pwn200 WP
  9. oracle--共享磁盘挂载
  10. C#读取匿名对象的属性值的方法总结