[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.
-- 
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.
#! /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
-- 
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.
#! /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
-- 
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.

Reply to: