3 ### ftpsync configuration for the Debian main archive.
5 ## Mirrorname. This is used for things like the trace file and should always
6 ## be the full hostname of the mirror.
7 #MIRRORNAME=`hostname -f`
9 ## Destination of the mirrored files. Should be an empty directory.
10 ## CAREFUL, this directory will contain the mirror. Everything else that
11 ## might have happened to be in there WILL BE GONE after the mirror sync!
12 TO="/mnt/ftp/pub/mirrors/debian/"
14 ## The upstream name of the rsync share.
17 ## The host we mirror from
18 RSYNC_HOST=ftp.uk.debian.org
20 ## In case we need a user to access the rsync share at our upstream host
23 ## If we need a user we also need a password
26 ## In which directory should logfiles end up
27 ## Note that BASEDIR defaults to $HOME, but can be set before calling the
28 ## ftpsync script to any value you want (for example using pam_env)
29 #LOGDIR="${BASEDIR}/log"
31 ## Name of our own logfile.
32 ## Note that ${NAME} is set by the ftpsync script depending on the way it
33 ## is called. See README for a description of the multi-archive capability
34 ## and better always include ${NAME} in this path.
35 #LOG="${LOGDIR}/${NAME}.log"
37 ## The script can send logs (or error messages) to a mail address.
38 ## If this is unset it will default to the local root user unless it is run
39 ## on a .debian.org machine where it will default to the mirroradm people.
42 ## If you do want a mail about every single sync, set this to false
43 ## Everything else will only send mails if a mirror sync fails
46 ## If you want the logs to also include output of rsync, set this to true.
47 ## Careful, the logs can get pretty big, especially if it is the first mirror
51 ## If you do want to exclude files from the mirror run, put --exclude
52 ## statements here. See rsync(1) for the exact syntax, these are passed to
53 ## rsync as written here. DO NOT TRY TO EXCLUDE ARCHITECTURES OR SUITES WITH
54 ## THIS, IT WILL NOT WORK!
57 ## If you do want to exclude an architecture, this is for you.
58 ## Use as space seperated list.
59 ## Possible values are:
60 ## alpha, amd64, arm, armel, hppa, hurd-i386, i386, ia64, kfreebsd-amd64,
61 ## kfreebsd-i386, m68k, mipsel, mips, powerpc, s390, sh, sparc and source
62 ## eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 sparc"
63 ## An unset value will mirror all architectures (default!)
66 ## Actually, no: we want to /include/ only some architectures. So we need to
67 ## find out which ones are available so that we can exclude the ones we don't
71 ## Check the available distributions for architectures.
72 for dist in oldstable stable testing unstable experimental; do
73 rsync --list-only $RSYNC_HOST::$RSYNC_PATH/dists/$dist/main/
76 ## Gather up excluded architectures as we go.
79 while read mode size date time name; do
81 ## Check directories of binary packages. If it's an architecture we
82 ## don't want to reject, then continue on.
84 (binary-all | binary-i386 | binary-amd64) continue ;;
89 ## Pick out the architecture name. Check whether we've seen it before.
95 excludes="${excludes+$excludes }$arch"
100 ## Done. Print out the finished list.
105 ## Do we have leaf mirror to signal we are done and they should sync?
106 ## If so set it to true and make sure you configure runmirrors.mirrors
107 ## and runmirrors.conf for your need.
110 ## We do create three logfiles for every run. To save space we rotate them,
111 ## this defines how many we keep
114 ## Our own lockfile (only one sync should run at any time)
115 #LOCK="${TO}/Archive-Update-in-Progress-${MIRRORNAME}"
117 ## Timeout for the lockfile, in case we have bash older than v4 (and no
119 # LOCKTIMEOUT=${LOCKTIMEOUT:-3600}
121 ## The following file is used to make sure we will end up with a correctly
122 ## synced mirror even if we get multiple pushes in a short timeframe
123 #UPDATEREQUIRED="${TO}/Archive-Update-Required-${MIRRORNAME}"
125 ## The trace file is used by a mirror check tool to see when we last had a
126 ## successful mirror sync. Make sure that it always ends up in project/trace
127 ## and always shows the full hostname. This is *relative* to ${TO}
128 #TRACE="project/trace/${MIRRORNAME}"
130 ## We sync our mirror using rsync (everything else would be insane), so
131 ## we need a few options set.
133 RSYNC="timeout 6h rsync"
135 ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T!
136 ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T!
137 ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T!
138 ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T!
140 ## limit I/O bandwidth. Value is KBytes per second, unset or 0 means
144 ## Default rsync options every rsync invocation sees.
145 #RSYNC_OPTIONS="-prltvHSB8192 --timeout 3600 --stats --exclude Archive-Update-in-Progress-${MIRRORNAME} --exclude ${TRACE} --exclude Archive-Update-Required-${MIRRORNAME}"
147 ## Options the first pass gets. We do not want the Packages/Source indices
148 ## here, and we also do not want to delete any files yet.
149 #RSYNC_OPTIONS1="--exclude Packages* --exclude Sources* --exclude Release* --exclude InRelease --exclude ls-lR*"
151 ## Options the second pass gets. Now we want the Packages/Source indices too
152 ## and we also want to delete files. We also want to delete files that are
154 #RSYNC_OPTIONS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded"
156 ## You may establish the connection via a web proxy by setting the
157 ## environment variable RSYNC_PROXY to a hostname:port pair pointing to your
158 ## web proxy. Note that your web proxy's configuration must support proxy
159 ## connections to port 873.
162 ## The following three options are used in case we want to "callback" the
163 ## host we got pushed from.
164 #CALLBACKUSER="archvsync"
168 ## Hook scripts can be run at various places during the sync.
169 ## Leave them blank if you don't want any
170 ## Hook1: After lock is acquired, before first rsync
171 ## Hook2: After first rsync, if successful
172 ## Hook3: After second rsync, if successful
173 ## Hook4: Right before leaf mirror triggering
174 ## Hook5: After leaf mirror trigger, only if we have slave mirrors (HUB=true)
176 ## Note that Hook3 and Hook4 are likely to be called directly after each
177 ## other. Difference is: Hook3 is called *every* time the second rsync was
178 ## successful, but even if the mirroring needs to re-run thanks to a second
179 ## push. Hook4 is only effective if we are done with mirroring.