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

Re: Rsync



From: "Chapman, Matt" <chapmam2@ocps.k12.fl.us>
Subject: Rsync
Date: Thu, 1 Nov 2001 14:23:12 -0500 

> Does anyone have a sample rsync conf for syncing woody?  And about how large
> would the directory have to be to hold it?
>  
> -matt
The following script to used to mirror i386 part of stable, testing and unstable,
It was modified from the sample from Debian's WWW site(www.debian.org).

It seems that only mirroring woody without potato is impossible, say
many packages of woody is also the packages of potato.

BTW: It seems that unstable(aka. sid) shares the main part with
testing(now woody).

Regards Su

#! /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 *s390.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 *-s360.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/ "
#--exclude /contrib/ --exclude /non-free/ --exclude source/\
#    --exclude Incoming/ \

TO=/home/ftp/debian/
#RSYNC_HOST=ftp.au.debian.org
RSYNC_HOST=ftp.debian.org.hk
#RSYNC_HOST=planetmirror.com
#RSYNC_HOST=ftp.hk.debian.org
#RSYNC_HOST=ftp.jp.debian.org
RSYNC_HOST=ftp.us.debian.org
#RSYNC_HOST=ftp.eecs.umich.edu
#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: