定时任务

#mirror web
*/5 * * * * cd /mirror && git pull
#mysql mirror
0 */3 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-connectors-community-el7/ /mirror/mysql/yum/mysql-connectors-community-el7/ > /dev/null 2>&1;
0 */3 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-tools-community-el7/ /mirror/mysql/yum/mysql-tools-community-el7/ > /dev/null 2>&1;
0 */3 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/ /mirror/mysql/yum/mysql57-community-el7/ > /dev/null 2>&1;
0 */3 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql80-community-el7/ /mirror/mysql/yum/mysql80-community-el7/ > /dev/null 2>&1;
#centos mirror
0 */4 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/centos/ /mirror/centos/ > /dev/null 2>&1;
#epel mirror
0 */4 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/epel/ /mirror/epel/ > /dev/null 2>&1;
#ubuntu-mirror
0 */4 * * * bash /srv/sh/apt-mirror.sh
#zabbix-mirror
0 */6 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/ /mirror/zabbix/3.4/ > /dev/null 2>&1;
0 */6 * * * rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/ /mirror/zabbix/4.0/ > /dev/null 2>&1;

定时任务脚本

#!/bin/bash
killall -9 apt-mirror
killall -9 wget
rm -rf /mirror/apt-mirror/var/apt-mirror.lock
#同步
/usr/sbin/apt-mirror > /srv/logs/apt-mirror/apt-mirror-`date +%Y-%m-%d-%H:%M:%S`.log
sleep 10s
#自动清理
sh /mirror/apt-mirror/var/clean.sh
#删除一周前的日志
find /srv/logs/apt-mirror/*.log -type f -mtime +2 -exec rm {} \;

配置同步内容

# apt-mirror configuration file
## The default configuration options (uncomment and change to override)
set base_path /mirror/apt-mirror
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var ## set defaultarch <running host architecture>
set nthreads 20
set _tilde 0
set defaultarch amd64 ## mirror sources
#ubuntu14.04 LTS
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
#ubuntu16.04 LTS
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
#ubuntu18.04 LTS
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse ## Cleaner configuration example
# set cleanscript $var_path/clean.sh
# Cleaning section
clean https://mirrors.tuna.tsinghua.edu.cn/ubuntu

ubuntu 镜像站部署的更多相关文章

  1. 树莓派及其他硬件平台国内外Linux镜像站全汇总

    转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...

  2. 中国Linux源镜像站大全

    原文链接:http://www.centoscn.com/yunwei/news/2012/1227/131.html 一.国内的linux源镜像站点: 1.企业源:阿里云开源镜像站: http:// ...

  3. kFreeBsd 国内开源镜像站汇总

    从http://bbs.chinaunix.net/archiver/tid-3756178.html这里抽取了debian源中支撑kfreebsd架构的源. 中科大: http://debian.u ...

  4. 使用VMDepot镜像快速部署CKAN开放数据门户

    最新发布的CKAN VMDepot镜像针对中国用户强化了中文支持,提升了与MS Office办公软件的互操作性,并集成了常用插件和最佳实践配置参数. 使得CKAN原本十分复杂繁琐的部署流程变得非常简单 ...

  5. 搭建本地Ubuntu 镜像服务器

    一.需求分析 最近公司软件Team 有个需求是这样的:能不能在局域网搭建一个Ubuntu 镜像服务器, 这样作的好处是可以节省Ubuntu某些常用工具的安装时间. 二.部署过程 2.1 测试环境 目前 ...

  6. 中国Linux开源镜像站大全

    本文来源:各大开源软件.发行版镜像页面.       请注意这是一个总结,如果您自己搭建了一个小型开源镜像,这里并没有.以下列出的是包含大量不同镜像的站点.       具体配置中,我建议您使用大企业 ...

  7. Android SDK使用国内镜像站,解决下载速度慢无法更新?

    1. 国内android开源镜像网站 下面是国内几个比較知名的开源网站.我用的是电子科技大学的镜像源,下载速度很快. mirrors.neusoft.edu.cn //东软信息学院 ubuntu.bu ...

  8. 开源镜像站-Android镜像

    mirrors.neusoft.edu.cn www.opencas.org ubuntu.buct.edu.cn Android developer 最新国内镜像:http://wear.techb ...

  9. 如何快速下载ubuntu镜像

    使用国内镜像地址下载: 中科大http://mirrors.ustc.edu.cn/ubuntu-releases/ 阿里云开源镜像站http://mirrors.aliyun.com/ubuntu- ...

随机推荐

  1. 2018.10.16 NOIP模拟 长者(主席树+hash)

    传送门 考试的时候开始sb的以为需要可持久化trietrietrie树,发现建树时空都是O(n2)O(n^2)O(n2)的. 然后发现由于每次只从原来的字符串改一个字符. 因此直接主席树维护区间has ...

  2. web前端技术合集

    视频课程包含: 微服务精品课程包含:Ajax和Jquery基础入门视频.ajax教程.css视频教程.JQuery视频教程.MUI快速混合APP开发-视频.vuejs教程.极客学院HTML5全套教程. ...

  3. 转@RequestParam,@PathParam,@PathVariable等注解区别

    转自:http://blog.csdn.net/u011410529/article/details/66974974 @RequestParam 和 @PathVariable 注解是用于从requ ...

  4. Fortran 数据类型

  5. python编码(五)

    说说区位码.GB2312.内码和代码页 目前Windows的内核已经采用Unicode编码,这样在内核上可以支持全世界所有的语言文字.但是由于现有的大量程序和文档都采用了某种特定语言的编码,例如GBK ...

  6. HDU1175 连连看(bfs) 2016-07-24 13:27 115人阅读 评论(0) 收藏

    连连看 Problem Description "连连看"相信很多人都玩过.没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子.如果某两个相同的棋子,可以通 ...

  7. Linux下配置Nginx(在root的/etc/rc.local里配置开机启动功能http://tengine.taobao.org/)

    上面是下载的包下载地址 http://tengine.taobao.org/download_cn.html nginx官网http://nginx.org/ 下一步 下一步 其中remote为重要属 ...

  8. poj3321-Apple Tree(DFS序+树状数组)

    Apple Tree Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 36442   Accepted: 10894 Desc ...

  9. 团队作业(HCL队)第三周—需求改进和系统分析

    2.需求&原型改进: 1.问题:游戏中坦克的移动和攻击怎么控制的? 改进: 在游戏中,我控制我方坦克,按下方向键坦克便向按下的方向移动,按下Z键,我方坦克发射炮弹.敌方坦克面向随机的方向移动, ...

  10. [redis]Redis Transaction

    https://github.com/phpredis/phpredis#transactions Transactions multi, exec, discard - Enter and exit ...