zoukankan      html  css  js  c++  java
  • ubuntu 镜像站部署

    定时任务

    #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
    
  • 相关阅读:
    hdoj 4006 The kth great number【优先队列】
    hdoj 1509 Windows Message Queue【优先队列】
    nyoj 55 懒省事的小明【优先队列】
    hdoj 1896 Stones【优先队列】
    nyoj 757 期末考试【优先队列+贪心】
    hdoj 2147 kiki's game【博弈】
    hdoj 1873 看病要排队【优先队列】
    hdoj 1789 Doing Homework again
    nyoj 1036 非洲小孩【贪心区间选点】
    转:栈和队列小知识【STL用法】
  • 原文地址:https://www.cnblogs.com/lizhaojun-ops/p/10794411.html
Copyright © 2011-2022 走看看