#!/bin/sh
-. ../OPTIONS.sh
-
RSYNCSOURCE=rsync://archive.ubuntu.com/ubuntu
#RSYNCSOURCE=rsync://ubuntu.media.mit.edu/ubuntu
BASEDIR=${MIRRORDIR}/ubuntu
+set -x
+set -v
+set -e
+set -u
+
+# 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
+PASS1=(--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude InRelease --exclude i18n/\* --exclude ls-lR\* --exclude Translation\*)
+
rsync --recursive --times --links --hard-links \
--stats \
- -P \
- --exclude "Packages*" --exclude "Sources*" \
- --exclude "Release*" \
- ${RSYNCSOURCE} ${BASEDIR} | tee -a ~/rsync.log
+ --verbose --timeout=600 \
+ "${PASS1[@]}" \
+ ${RSYNCSOURCE} ${BASEDIR}
rsync --recursive --times --links --hard-links \
--stats --delete --delete-after \
- -P \
+ --verbose --timeout=600 \
--exclude "project/trace/${HOSTNAME}" \
- ${RSYNCSOURCE} ${BASEDIR} | tee -a ~/rsync.log
+ ${RSYNCSOURCE} ${BASEDIR}