制作ubuntu mirror源的镜像服务器

十一月 23rd, 2009 Posted in Ubuntu | 阅读次数: 453 次

Author:gaojinbo
Time:2009-11-23
以下脚本是同步ubuntu官方镜像到本地磁盘,也就是制作自己的ubuntu mirror

1.制作同步脚本
vi ubuntu-mirror.sh

#! /bin/bash

if [ $(/bin/ps aux |grep  tw.archive.ubuntu.com  |wc -l ) -le  1 ];
then
        rsync -aPS –delete-after \
        –exclude *ia64*        –exclude *powerpc* –exclude *sparc* \
                –exclude *hoary* –exclude *warty* –exclude *dapper* \
                –exclude *breezy* \
                –exclude *.iso \
                –exclude *.orig.tar.gz –exclude *.diff.gz \
                –exclude *.dsc \
                rsync://tw.archive.ubuntu.com/ubuntu \
                /data1/ubuntu
else
  echo  rsync  runing
fi

 

2.增加执行权限
chmod +x ubuntu-mirror.sh

 

3.每隔5分钟自动同步一次
crontab -e
*/5 * * * * /home/ylmf/ubuntu-mirror.sh

说明:/data1/ubuntu是本地磁盘目录,以上脚本会同步最新的几个发行版,排除了iso等

完成!

相关日志:

Tags: ,

5 Responses to “制作ubuntu mirror源的镜像服务器”

  1. Overcome Panic Attacks Says:

    Recent Favourite Websites…

    [...]while the sites I link to below are completely unrelated to mine, I think they are worth a read, so go and have a look http://www.panicattackstreatmentcure.net/links/…...


  2. Anxiety Treatments Says:

    Recent Websites I Like…

    [...]here are some other links to sites that I link to because I think they are really worth visiting: http://www.panicattackstreatmentcure.net/links/…...


  3. Related Resources Says:

    Related Websites…

    [...]some other related resources on the web that are worth viewing on this subject include[...]…


  4. seo services Says:

    The best website……

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……


  5. Gucci Solbriller Says:

    Cool sites……

    [...]we came across a cool site that you might enjoy. Take a look if you want[...]………


留下您的脚印