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

[gulliver] Atelier miroir Debian


From Frédéric Lehobey <Frederic dot Lehobey at free dot fr>
Subject [gulliver] Atelier miroir Debian
Date Mon, 3 Nov 2003 00:48:14 +0100

Salut,

  OpenOffice.org vient de rentrer dans le « main » de la Debian.

  Ça va me permettre de réduire mon miroir de la Debian au seul
« main » désormais (en stable/testing/unstable et
linux-i386/linux-powerpc/hurd-i386).

  Mais comme je ne suis pas le seul à faire cela (ou à y être
intéressé) dans Gulliver, je propose de monter un atelier « miroir
Debian » afin de s'échanger trucs et astuces (quelles méthodes,
machines non connectées en permanence, etc...).

  Pour commencer, je vous donne mon adaptation du script
<http://www.debian.org/mirror/anonftpsync> conseillé par
<http://www.debian.org/mirror/>. Mais il ne répond pas encore à tous
mes besoins (l'exclusion de /non-free/ ne suffit pas).

Librement,
Frédéric
-------------------------------------------------------------------------
#! /bin/sh
set -e

# This script originates from http://www.debian.org/mirror/anonftpsync

# Note: You MUST have rsync 2.0.16-1 or newer, which is available in slink
# and all newer Debian releases, or at http://rsync.samba.org/

# 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.

# Don't forget:
# chmod 744 anonftpsync

# TO is the destination for the base of the Debian mirror directory
# (the dir that holds dists/ and ls-lR).

TO=/var/www/debian

# RSYNC_HOST is the site you have chosen from the mirrors file.
# (http://www.debian.org/mirror/list-full)

RSYNC_HOST=ftp.de.debian.org

# RSYNC_DIR is the directory given in the "Packages over rsync:" line of
# the mirrors file for the site you have chosen to mirror.

RSYNC_DIR=debian/

# EXCLUDE is a list of parameters listing patterns that rsync will exclude.
# The following example would exclude mostly everything:
#EXCLUDE="\
#  --exclude binary-alpha/ --exclude *_alpha.deb --exclude disks-alpha/ \
#   --exclude *_alpha.udeb --exclude *_alpha.changes \
#    --exclude Contents-alpha.gz \
# \
#  --exclude binary-arm/ --exclude *_arm.deb --exclude disks-arm/ \
#   --exclude *_arm.udeb --exclude *_arm.changes \
#    --exclude Contents-arm.gz \
# \
#  --exclude binary-hppa/ --exclude *_hppa.deb --exclude disks-hppa/ \
#   --exclude *_hppa.udeb --exclude *_hppa.changes \
#    --exclude Contents-hppa.gz \
# \
#  --exclude binary-i386/ --exclude *_i386.deb --exclude disks-i386/ \
#   --exclude *_i386.udeb --exclude *_i386.changes
#    --exclude Contents-i386.gz \
# \
#  --exclude binary-ia64/ --exclude *_ia64.deb --exclude disks-ia64/ \
#   --exclude *_ia64.udeb --exclude *_ia64.changes \
#    --exclude Contents-ia64.gz \
# \
#  --exclude binary-m68k/ --exclude *_m68k.deb --exclude disks-m68k/ \
#   --exclude *_m68k.udeb --exclude *_m68k.changes \
#    --exclude Contents-m68k.gz \
# \
#  --exclude binary-mips*/ --exclude *_mips.deb --exclude disks-mips*/ \
#   --exclude *_mips.udeb --exclude *_mips.changes \
#                          --exclude *_mipsel.deb \
#    --exclude Contents-mips.gz \
#   --exclude *_mipsel.udeb --exclude *_mipsel.changes \
#    --exclude Contents-mipsel.gz \
# \
#  --exclude binary-powerpc/ --exclude *_powerpc.deb --exclude disks-powerpc/ \
#   --exclude *_powerpc.udeb --exclude *_powerpc.changes \
#    --exclude Contents-powerpc.gz \
# \
#  --exclude binary-s390/ --exclude *_s390.deb --exclude disks-s390/ \
#   --exclude *_s390.udeb --exclude *_s390.changes \
#    --exclude Contents-s390.gz \
# \
#  --exclude binary-sh/ --exclude *_sh.deb --exclude disks-sh/ \
#   --exclude *_sh.udeb --exclude *_sh.changes \
#    --exclude Contents-sh.gz \
# \
#  --exclude binary-sparc/ --exclude *_sparc.deb --exclude disks-sparc/ \
#   --exclude *_sparc.udeb --exclude *_sparc.changes \
#    --exclude Contents-sparc.gz \
# \
#  --exclude binary-hurd-i386/ --exclude *_hurd-i386.deb \
#   --exclude disks-hurd-i386/ \
#    --exclude Contents-hurd-i386.gz \
# \
#  --exclude stable/ --exclude testing/ --exclude unstable/ \
# \
#  --exclude source/ \
#  --exclude *.orig.tar.gz --exclude *.diff.gz --exclude *.dsc \
# \
#  --exclude /contrib/ --exclude /non-free/ \
# "

# With a blank EXCLUDE you will mirror the entire archive.

EXCLUDE="\
 --exclude binary-alpha/ --exclude *_alpha.deb --exclude disks-alpha/ \
  --exclude *_alpha.udeb --exclude *_alpha.changes \
   --exclude Contents-alpha.gz \
\
 --exclude binary-arm/ --exclude *_arm.deb --exclude disks-arm/ \
  --exclude *_arm.udeb --exclude *_arm.changes \
   --exclude Contents-arm.gz \
\
 --exclude binary-hppa/ --exclude *_hppa.deb --exclude disks-hppa/ \
  --exclude *_hppa.udeb --exclude *_hppa.changes \
   --exclude Contents-hppa.gz \
\
 --exclude binary-ia64/ --exclude *_ia64.deb --exclude disks-ia64/ \
  --exclude *_ia64.udeb --exclude *_ia64.changes \
   --exclude Contents-ia64.gz \
\
 --exclude binary-m68k/ --exclude *_m68k.deb --exclude disks-m68k/ \
  --exclude *_m68k.udeb --exclude *_m68k.changes \
   --exclude Contents-m68k.gz \
\
 --exclude binary-mips*/ --exclude *_mips.deb --exclude disks-mips*/ \
  --exclude *_mips.udeb --exclude *_mips.changes \
                         --exclude *_mipsel.deb \
   --exclude Contents-mips.gz \
  --exclude *_mipsel.udeb --exclude *_mipsel.changes \
   --exclude Contents-mipsel.gz \
\
 --exclude binary-s390/ --exclude *_s390.deb --exclude disks-s390/ \
  --exclude *_s390.udeb --exclude *_s390.changes \
   --exclude Contents-s390.gz \
\
 --exclude binary-sh/ --exclude *_sh.deb --exclude disks-sh/ \
  --exclude *_sh.udeb --exclude *_sh.changes \
   --exclude Contents-sh.gz \
\
 --exclude binary-sparc/ --exclude *_sparc.deb --exclude disks-sparc/ \
  --exclude *_sparc.udeb --exclude *_sparc.changes \
   --exclude Contents-sparc.gz \
\
 --exclude testing/ \
\
 --exclude /non-free/ \
"


# There should be no need to edit anything below this point, unless there
# are problems.

#-----------------------------------------------------------------------------#

# Note: on some non-Debian systems, hostname doesn't accept -f option.
# If that's the case on your system, make sure hostname prints the full
# hostname, and remove the -f option. If there's no hostname command,
# explicitly replace `hostname -f` with the hostname.
HOSTNAME=`hostname -f`

LOCK="${TO}/Archive-Update-in-Progress-${HOSTNAME}"

# 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
# Note: on some non-Debian systems, trap doesn't accept "exit" as signal
# specification. If that's the case on your system, try using "0".
trap "rm -f $LOCK > /dev/null 2>&1" exit

set +e
rsync --recursive --links --hard-links --times --verbose --compress --delete \
     --exclude "Archive-Update-in-Progress-${HOSTNAME}" \
     --exclude "project/trace/${HOSTNAME}" \
     $EXCLUDE \
     $RSYNC_HOST::$RSYNC_DIR $TO > rsync.log 2>&1
date -u > "${TO}/project/trace/${HOSTNAME}"

# Note: if you don't have savelog, use any other log rotation facility, or
# comment this out, the log will simply be overwritten each time.
savelog rsync.log > /dev/null 2>&1

---- Liste gulliver ----
Se désinscrire, mailto:gulliver-unsubscribe at listes dot gulliver dot eu dot org
GULLIVER,       http://gulliver.eu.org/