summaryrefslogtreecommitdiff
path: root/bin/ftpsync
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2008-11-15 15:28:41 +0100
committerJoerg Jaspert <joerg@debian.org>2008-11-15 15:28:41 +0100
commit2fde2246b43269ccba8e8773be9e49b3a04ed0a1 (patch)
treec510a92bea3d045250fb95756d5211b0d82ddceb /bin/ftpsync
parent7ad0f9242bb95b48f9b791ccc8718d2c8a73d42d (diff)
ftpsync: rerun stage1 already if needed, not only after stage2
Signed-off-by: Joerg Jaspert <joerg@debian.org>
Diffstat (limited to 'bin/ftpsync')
-rwxr-xr-xbin/ftpsync25
1 files changed, 14 insertions, 11 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index 6aa9a08..0378add 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -369,24 +369,27 @@ export RSYNC_PROXY
while [ -e "${UPDATEREQUIRED}" ]; do
log "Running mirrorsync, update is required, ${UPDATEREQUIRED} exists"
- rm -f "${UPDATEREQUIRED}"
# if we want stage1 *or* all
if [ "xtruex" = "x${SYNCSTAGE1}x" ] || [ "xtruex" = "x${SYNCALL}x" ]; then
- log "Running stage1: ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS1} ${EXCLUDE} ${SOURCE_EXCLUDE} ${RSYNCPTH}::${RSYNC_PATH} ${TO}"
-
- set +e
- # Step one, sync everything except Packages/Releases
- ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS1} ${EXCLUDE} ${SOURCE_EXCLUDE} \
- ${RSYNCPTH}::${RSYNC_PATH} "${TO}" >"${LOGDIR}/rsync-${NAME}.log" 2>"${LOGDIR}/rsync-${NAME}.error"
- result=$?
- set -e
-
- log "Back from rsync with returncode ${result}"
+ while [ -e "${UPDATEREQUIRED}" ]; do
+ rm -f "${UPDATEREQUIRED}"
+ log "Running stage1: ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS1} ${EXCLUDE} ${SOURCE_EXCLUDE} ${RSYNCPTH}::${RSYNC_PATH} ${TO}"
+
+ set +e
+ # Step one, sync everything except Packages/Releases
+ ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS1} ${EXCLUDE} ${SOURCE_EXCLUDE} \
+ ${RSYNCPTH}::${RSYNC_PATH} "${TO}" >"${LOGDIR}/rsync-${NAME}.log" 2>"${LOGDIR}/rsync-${NAME}.error"
+ result=$?
+ set -e
+
+ log "Back from rsync with returncode ${result}"
+ done
else
# Fake a good resultcode
result=0
fi # Sync stage 1?
+ rm -f "${UPDATEREQUIRED}"
check_rsync $result "Sync step 1 went wrong, got errorcode ${result}. Logfile: ${LOG}" || exit 3