[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

谁有兴趣在 CERNET 内再做几个 Debian 的 ftp mirror?



目前大陆地区, 好象 只有 linuxforum 和 我的hua.math.ustc.edu.cn
两个 Debian 的 ftp mirror, 这比起其它地区来, 实在是太少了.

我的 server 在 CERNET 内, 所以通常只有 CERNET 内的用户才能
访问到, 鉴于 CERNET 是一个很封闭的环境, 但是其使用者却是中国
大陆的科研和教育单位, 所以我建议有条件的朋友再作几个 mirror.
如果, 你没有 出 CERNET 的 proxy, 就请从我这里的 hua.math.ustc.edu.cn
进行 mirror.


我已经在 hua.math.ustc.edu.cn 上配置了 rsync server.

export 了两个 module: debian/ 和 debian-non/
里面 只有 binary-i386, binary-all 和 source.
如果你想 mirror其它体系的binary, 我只能说抱歉了 :(
但 stable, testing 和 unstable 三个 dist 包括了.

总共 16GB 左右.

方法:
 你需要安装 rsync 
 并且配制一个 script --  anonftpsync, 这个在 debian 的主页上已经
 有样本了. 如果, 你从我这里 mirror, 我推荐使用我事先写好的这两个,
 在附件里, 已经作过测试. 你只须对其中的 TO 作一下修改.

如果, 你要mirror 这个站点, 我建议你在每天中午开始更新.
(我的 mirror 是每天凌晨 2:30 (北京时间) 开始更新的)
即在你的 crontab 里加上.
0 12     * * *  PATH/anonftpsync-nonus; PATH/anonftpsync

另外一个建议, 把 你的 mirror 目录放在同一个很大的分区上, 
大到mirror完成后后还能留下很大的空间. 
这样做的好处是方便你以后用 debian-cd 制作 Unofficial 的Debian CD set.
不然, 是很麻烦的, 因为做 Image 的时候要生成大量的 hard link.
#! /bin/sh -p
set -e

# Set the variables below to fit your site. You can then use cron to have this
# script run daily to automatically update your copy of the archive
#
# TO is the destination for the base of the debian directory (the dir that
# holds dists/ and ls-lR)
#
# RSYNC_HOST is the site you have chosen from the mirrors file
#
# RSYNC_DIR is the directory given in the Archive-rsync: line of the
# mirrors file for the site you have chosen to mirror.
#
# chmod 744 anonftpsync
#
# You MUST have rsync 2.0.16-1 or newer which is available in slink

# With a blank EXCLUDE you will mirror the entire archive.
# EXCLUDE="--exclude *alpha.deb \
#     --exclude *arm.deb \
#     --exclude *m68k.deb \
#     --exclude *hppa.deb \
#     --exclude *hurd-i386.deb \
#     --exclude *ia64.deb \
#     --exclude *powerpc.deb \
#     --exclude *mips.deb \
#     --exclude *mipsel.deb \
#     --exclude *s360.deb \
#     --exclude *sh.deb \
#     --exclude *sparc.deb \
#     --exclude /Debian-1.3* \
#     --exclude binary-alpha/ \
#     --exclude binary-arm/ \
#     --exclude binary-m68k/ \
#     --exclude binary-powerpc/ \
#     --exclude binary-hppa/ \
#     --exclude binary-hurd-i386/ \
#     --exclude binary-ia64/ \
#     --exclude binary-mips/ \
#     --exclude binary-mipsel/ \
#     --exclude binary-s390/ \
#     --exclude binary-sh/ \
#     --exclude binary-sparc/ \
#     --exclude disks-alpha/ \
#     --exclude disks-arm/ \
#     --exclude disks-m68k/ \
#     --exclude disks-powerpc/ \
#     --exclude disks-hppa/ \
#     --exclude disks-hurd-i386/ \
#     --exclude disks-ia64/ \
#     --exclude disks-mips/ \
#     --exclude disks-mipsel/ \
#     --exclude disks-s390/ \
#     --exclude disks-sh/ \
#     --exclude disks-sparc/ \
#     --exclude *-arm.gz \
#     --exclude *-alpha.gz \
#     --exclude *-m68k.gz \
#     --exclude *-hppa.gz \
#     --exclude *-powerpc.gz \
#     --exclude *-hurd-i386.gz \
#     --exclude *-ia64.gz \
#     --exclude *-mpis.gz \
#     --exclude *-mpisel.gz \
#     --exclude *-s390.gz \
#     --exclude *-sparc.gz \
#     --exclude *-sh.gz \
#     --exclude local/ \
#     --exclude stable/ \
#     --exclude slink-proposed-updates/ \
#     --exclude slink/ \
#     --exclude bo/ \
#     --exclude bo-unstable/ \
#     --exclude bo-updates/ "



TO=/home/ftp/debian
#TO=/home/ftp/debian-nonus
RSYNC_HOST=hua.math.ustc.edu.cn
#RSYNC_HOST=ftp.au.debian.org
#RSYNC_HOST=ftp.jp.debian.org
#SYNC_HOST=download.sourceforge.net
#RSYNC_HOST=www2.linuxforum.net
#RSYNC_HOST=bigfoot.eecs.umich.edu
RSYNC_DIR=debian/
EXCLUDE=""

LOCK="${TO}/Archive-Update-in-Progress-`hostname -f`"

# Get in the right directory and set the umask to be group writable
# 
cd $HOME
umask 002

# Check to see if another sync is in progress
if lockfile -! -l 43200 -r 0 "$LOCK"; then
  echo `hostname` is unable to start rsync, lock file exists
  exit 1
fi
trap "rm -f $LOCK > /dev/null 2>&1" exit  

set +e

#result=1
#while (( $result != 0 )) ; do
rsync -rltvz --progress --delete \
     --exclude "Archive-Update-in-Progress-`hostname -f`" \
     --exclude "project/trace/`hostname -f`" \
     $EXCLUDE \
     $RSYNC_HOST::$RSYNC_DIR $TO > rsync.log 2>&1
#result=$?
#done

date -u > "${TO}/project/trace/`hostname -f`"
savelog rsync.log > /dev/null 2>&1
#! /bin/sh -p
set -e

# Set the variables below to fit your site. You can then use cron to have this
# script run daily to automatically update your copy of the archive
#
# TO is the destination for the base of the debian directory (the dir that
# holds dists/ and ls-lR)
#
# RSYNC_HOST is the site you have chosen from the mirrors file
#
# RSYNC_DIR is the directory given in the Archive-rsync: line of the
# mirrors file for the site you have chosen to mirror.
#
# chmod 744 anonftpsync
#
# You MUST have rsync 2.0.16-1 or newer which is available in slink

# With a blank EXCLUDE you will mirror the entire archive.
# EXCLUDE="--exclude *alpha.deb \
#     --exclude *arm.deb \
#     --exclude *m68k.deb \
#     --exclude *hppa.deb \
#     --exclude *hurd-i386.deb \
#     --exclude *ia64.deb \
#     --exclude *powerpc.deb \
#     --exclude *mips.deb \
#     --exclude *mipsel.deb \
#     --exclude *s360.deb \
#     --exclude *sh.deb \
#     --exclude *sparc.deb \
#     --exclude /Debian-1.3* \
#     --exclude binary-alpha/ \
#     --exclude binary-arm/ \
#     --exclude binary-m68k/ \
#     --exclude binary-powerpc/ \
#     --exclude binary-hppa/ \
#     --exclude binary-hurd-i386/ \
#     --exclude binary-ia64/ \
#     --exclude binary-mips/ \
#     --exclude binary-mipsel/ \
#     --exclude binary-s390/ \
#     --exclude binary-sh/ \
#     --exclude binary-sparc/ \
#     --exclude disks-alpha/ \
#     --exclude disks-arm/ \
#     --exclude disks-m68k/ \
#     --exclude disks-powerpc/ \
#     --exclude disks-hppa/ \
#     --exclude disks-hurd-i386/ \
#     --exclude disks-ia64/ \
#     --exclude disks-mips/ \
#     --exclude disks-mipsel/ \
#     --exclude disks-s390/ \
#     --exclude disks-sh/ \
#     --exclude disks-sparc/ \
#     --exclude *-arm.gz \
#     --exclude *-alpha.gz \
#     --exclude *-m68k.gz \
#     --exclude *-hppa.gz \
#     --exclude *-powerpc.gz \
#     --exclude *-hurd-i386.gz \
#     --exclude *-ia64.gz \
#     --exclude *-mpis.gz \
#     --exclude *-mpisel.gz \
#     --exclude *-s390.gz \
#     --exclude *-sparc.gz \
#     --exclude *-sh.gz \
#     --exclude local/ \
#     --exclude stable/ \
#     --exclude slink-proposed-updates/ \
#     --exclude slink/ \
#     --exclude bo/ \
#     --exclude bo-unstable/ \
#     --exclude bo-updates/ "



#TO=/home/ftp/debian
TO=/home/ftp/debian-nonus
RSYNC_HOST=hua.math.ustc.edu.cn
#RSYNC_HOST=ftp.au.debian.org
#RSYNC_HOST=ftp.jp.debian.org
#SYNC_HOST=download.sourceforge.net
#RSYNC_HOST=www2.linuxforum.net
#RSYNC_HOST=bigfoot.eecs.umich.edu
RSYNC_DIR=debian/
EXCLUDE=""

LOCK="${TO}/Archive-Update-in-Progress-`hostname -f`"

# Get in the right directory and set the umask to be group writable
# 
cd $HOME
umask 002

# Check to see if another sync is in progress
if lockfile -! -l 43200 -r 0 "$LOCK"; then
  echo `hostname` is unable to start rsync, lock file exists
  exit 1
fi
trap "rm -f $LOCK > /dev/null 2>&1" exit  

set +e

#result=1
#while (( $result != 0 )) ; do
rsync -rltvz --progress --delete \
     --exclude "Archive-Update-in-Progress-`hostname -f`" \
     --exclude "project/trace/`hostname -f`" \
     $EXCLUDE \
     $RSYNC_HOST::$RSYNC_DIR $TO > rsync.log 2>&1
#result=$?
#done

date -u > "${TO}/project/trace/`hostname -f`"
savelog rsync.log > /dev/null 2>&1

Reply to: