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

Re: Script Rsync pour mirroir



Le Wed, Jan 19, 2000 at 12:03:55PM +0100, Stephane Leclerc écrivait:
> Quelqu'un aurait-il un script resync pour mirroir Debian à me passer. Le 
> mien ne marche plus et je n'arrive pas à trouver le bug.

Les 4 fichiers sont joints. Mais rsync a un méchant bug qui le fait core
dumper régulièrement (le bug est déjà reporté)...

A+
-- 
Raphaël Hertzog >> 0C4CABF1 >> http://tux.u-strasbg.fr/~raphael/
<pub> CD Debian : http://tux.u-strasbg.fr/~raphael/debian/#cd </pub>
#! /bin/sh
set -e

. /rack/perso/paquets/debian/mirror/ftpsync.conf

export RSYNC_PASSWORD

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

# Get in the right directory and set the umask to be group writable
# 
cd /rack/perso/paquets/debian/mirror
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
rsync -rltvzH --size-only --delete \
     --exclude "Archive-Update-in-Progress-`hostname -f`" \
     --exclude "project/trace/`hostname -f`" \
     $EXCLUDE \
     $RSYNC_HOST::debian $TO > rsync.log 2>&1
date -u > "${TO}/project/trace/`hostname -f`"
savelog rsync.log > /dev/null 2>&1
#
# Set the variables below to fit your site.
#
# TO is the destination for the base of the debian directory (the dir that
# holds dists/ and ls-lR)
#
# RSYNC_HOST is the name of the upstream site
#
# RSYNC_DIR is the directory name given you by the upstream mirror
#
# RSYNC_USER is the username given you by the upstream mirror
#
# RSYNC_PASSWORD is the password given you by the upstream mirror
#
# You MUST have rsync 2.0.16-1 or newer which is available in slink
#
# chmod 744 ftpsync
# chmod 600 ftpsync.conf
# Add the ssh key to your .ssh/authorized_keys file
# Make sure that authorized_keys is world readable

#
#  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.
# This exclude list is what ftp1.us.debian.org uses
EXCLUDE="--exclude binary-alpha/ --exclude binary-m68k/ \
    --exclude binary-powerpc/ --exclude binary-sparc/ 
    --exclude binary-hurd-i386/ --exclude binary-arm/ \
    --exclude disks-m68k/ --exclude disks-powerpc/ \
    --exclude disks-sparc/ --exclude disks-alpha/ \
    --exclude disks-arm/ --exclude disks-hurd-i386/ \
    --include Packages.gz --exclude Packages \
    --exclude Contents-alpha.gz --exclude Contents-sparc.gz \
    --exclude Contents-m68k.gz --exclude Contents-powerpc.gz \
    --exclude Contents-hurd-i386.gz --exclude indices/Maintainers \
    --exclude ls-lR --exclude indices/Packages*"

TO=/ftp/debian
RSYNC_HOST=ftp.fr.debian.org
RSYNC_USER=debian
RSYNC_PASSWORD=""
#EXCLUDE=
#! /bin/sh
set -e

. /rack/perso/paquets/debian/mirror/ftpsync-non-US.conf

export RSYNC_PASSWORD

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

# Get in the right directory and set the umask to be group writable
# 
cd /rack/perso/paquets/debian/mirror
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
rsync -rltvzH --delete \
     --exclude "Archive-Update-in-Progress-`hostname -f`" \
     --exclude "project/trace/`hostname -f`" \
     $EXCLUDE \
     $RSYNC_HOST::debian-non-US $TO > rsync-non-US.log 2>&1
date -u > "${TO}/project/trace/`hostname -f`"
savelog rsync-non-US.log > /dev/null 2>&1

#
# Set the variables below to fit your site.
#
# TO is the destination for the base of the debian directory (the dir that
# holds dists/ and ls-lR)
#
# RSYNC_HOST is the name of the upstream site
#
# RSYNC_DIR is the directory name given you by the upstream mirror
#
# RSYNC_USER is the username given you by the upstream mirror
#
# RSYNC_PASSWORD is the password given you by the upstream mirror
#
# You MUST have rsync 2.0.16-1 or newer which is available in slink
#
# chmod 744 ftpsync-non-US
# chmod 600 ftpsync-non-US.conf
# Add the ssh key to your .ssh/authorized_keys file
# Make sure that authorized_keys is world readable

#
#  You MUST have rsync 2.0.16-1 or newer which is available in slink

EXCLUDE="--exclude binary-alpha/ --exclude binary-m68k/ \
    --exclude binary-powerpc/ --exclude binary-sparc/ 
    --exclude binary-hurd-i386/ --exclude binary-arm/ \
    --exclude disks-m68k/ --exclude disks-powerpc/ \
    --exclude disks-sparc/ --exclude disks-alpha/ \
    --exclude disks-arm/ --exclude disks-hurd-i386/ \
    --include Packages.gz --exclude Packages \
    --exclude Contents-alpha.gz --exclude Contents-sparc.gz \
    --exclude Contents-m68k.gz --exclude Contents-powerpc.gz \
    --exclude Contents-hurd-i386.gz --exclude indices/Maintainers \
    --exclude ls-lR --exclude indices/Packages*"

TO=/ftp/debian-non-US
RSYNC_HOST=ftp.fr.debian.org
#RSYNC_HOST=pandora.debian.org
RSYNC_USER=debian
RSYNC_PASSWORD=""
#EXCLUDE=


Reply to: