定时任务

#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. 前端之JavaScript笔记3

    一 创建添加节点 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  2. 浮点数转byte数组

    ; float b=34.56745f; float c=0.0; ,,,}; byte* t=fbs; float2Bytes(t,b); unsigned int addrF=(unsigned ...

  3. [GO]kafka的生产者和消费者

    生产者: package main import ( "github.com/Shopify/sarama" "fmt" "time" ) ...

  4. b3_trcd_EDCD_new

    # -*- coding:utf-8 -*- import re year="17A" ss='./data/' filename = ss+'EDCD%s.txt'%year ' ...

  5. 基于SceneControl单击查询功能的实现

    private void HandleIdentify_MouseDown(object sender, ISceneControlEvents_OnMouseDownEvent e) { this. ...

  6. Codeforces758A Holiday Of Equality 2017-01-20 10:08 48人阅读 评论(0) 收藏

    A. Holiday Of Equality time limit per test 1 second memory limit per test 256 megabytes input standa ...

  7. AOT和JIT以及混合编译的区别、优劣

    AOT,JIT是什么? JIT,即Just-in-time,动态(即时)编译,边运行边编译: AOT,Ahead Of Time,指运行前编译,是两种程序的编译方式 区别 这两种编译方式的主要区别在于 ...

  8. ALIZE初涉

    ALIZE初涉 在做GMM-UBM和i-vector时都用到了ALIZE,不得不说十分良心,在linux下很方便,但同时也有一些问题,流程总结如下 安装 在http://alize.univ-avig ...

  9. Date日期操作

    获取年月日时分秒: package com.util; import java.text.DateFormat; import java.util.Calendar; import java.util ...

  10. NLayerAppV3--基础结构层(Cross-Cutting部分)

    回顾:NLayerAppV3是一个使用.net 2.1实现的经典DDD的分层架构的项目. NLayerAppV3是在NLayerAppV2的基础上,使用.net core2.1进行重新构建的:它包含了 ...