]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/blob - fetch-scripts/debian
debian: Enable --safe-links
[sipb-mirrors.git] / fetch-scripts / debian
1 #! /bin/bash
2
3 set -x
4 set -v
5 set -e
6 set -u
7
8 #MIRRORDIR=/ifs/mirror
9 BASEDIR=${MIRRORDIR}/debian
10 RSYNCSOURCE=rsync://debian.gtisc.gatech.edu/debian
11
12 RSYNC_OPTS="--recursive --safe-links --times --sparse --block-size=8192 --timeout 3600 --perms"
13 #OTHER_OPTS="--verbose --stats --dry-run"
14 OTHER_OPTS="--verbose --stats"
15
16 # Options we only use in the first pass, where we do not want packages/sources to fly in yet and dont want to delete files
17 PASS1=(--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude InRelease --exclude i18n/\* --exclude ls-lR\* --exclude Translation\*)
18 # Options for the second pass, where we do want everything, including deletion of old and now unused files
19 PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded --exclude \"project/trace/${HOSTNAME}\""
20
21 # The temp directory used by rsync --delay-updates is not
22 # world-readable remotely. Always exclude it to avoid errors. 
23 EXCLUDE="--exclude .~tmp~/"
24
25 rsync ${RSYNC_OPTS} ${OTHER_OPTS} "${PASS1[@]}" ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
26 rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS2} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
27
28 mkdir -p ${BASEDIR}/project/trace
29 date -u > ${BASEDIR}/project/trace/mirrors.mit.edu