博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu 镜像站部署
阅读量:5883 次
发布时间:2019-06-19

本文共 3716 字,大约阅读时间需要 12 分钟。

定时任务

#mirror web*/5   *  *  *  *  cd /mirror && git pull#mysql mirror0  */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 mirror0  */4  *  *  *  rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/centos/  /mirror/centos/  > /dev/null 2>&1;#epel mirror0  */4  *  *  *  rsync -av --delete rsync://mirrors.tuna.tsinghua.edu.cn/epel/  /mirror/epel/  > /dev/null 2>&1;#ubuntu-mirror0  */4  *  *  *  bash /srv/sh/apt-mirror.sh#zabbix-mirror0  */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/bashkillall -9 apt-mirrorkillall -9 wgetrm -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`.logsleep 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-mirrorset mirror_path    $base_path/mirrorset skel_path      $base_path/skelset var_path       $base_path/var## set defaultarch  
set nthreads 20set _tilde 0set defaultarch amd64## mirror sources#ubuntu14.04 LTSdeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse#ubuntu16.04 LTSdeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse#ubuntu18.04 LTSdeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse## Cleaner configuration example# set cleanscript $var_path/clean.sh# Cleaning sectionclean https://mirrors.tuna.tsinghua.edu.cn/ubuntu

转载于:https://www.cnblogs.com/tchroot/p/10794411.html

你可能感兴趣的文章
information_schema系列四(跟踪,列约束,表和列)
查看>>
TreapDB is a key-value store based on Treap
查看>>
BINGMAPS地图下载及切图和重命名工具使用教程
查看>>
BYTE* To Float*
查看>>
(转)C# 把我所积累的类库全部分享给博友(附件已经上传)
查看>>
Silverlight5 无法切换输入法,无法输入中文的原因及解决初探
查看>>
游戏开发基础:方向键的组合,八方向实现
查看>>
黑书-DP-方块消除 ****
查看>>
MySQL 分区
查看>>
我的架构经验系列文章 - 后端架构 - 语言层面
查看>>
DEFERRED_SEGMENT_CREATION
查看>>
读取手机硬件信息
查看>>
一致哈希
查看>>
spring3: Bean的作用域
查看>>
The connection to adb is down, and a severe error has occured. 问题解决
查看>>
在Jenkins中配置运行远程shell命令
查看>>
代码杂记
查看>>
linux中防CC攻击两种实现方法(转)
查看>>
《Programming WPF》翻译 第9章 4.模板
查看>>
hdu2159
查看>>