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

[dak/master] Merge into a third dir, fetch from there.



avoids trouble with rsync partial names / slow uploads / ...
---
 scripts/debian/moveftp.sh | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/scripts/debian/moveftp.sh b/scripts/debian/moveftp.sh
index 5b16a9d..926a261 100755
--- a/scripts/debian/moveftp.sh
+++ b/scripts/debian/moveftp.sh
@@ -8,14 +8,26 @@ FTPDIR="/srv/upload.debian.org/ftp/pub/UploadQueue/"
 SSHDIR="/srv/upload.debian.org/UploadQueue/"
 HOST=$(hostname -s)
 
+# For usper, targetdir is the sshdir, everywhere else, its a seperate
+# one, so we avoid fetching partial uploads from their sshdir.
+if [[ ${HOST} == usper ]]; then
+    TARGETDIR="${SSHDIR}"
+    TOPROCESS="${FTPDIR}"
+else
+    TARGETDIR="/srv/upload.debian.org/mergedtree"
+    TOPROCESS="${FTPDIR} ${SSHDIR}"
+fi
+
 # This runs on all queue hosts - merge ftp and ssh together. (The queued on usper only processes
-# the SSHDIR)
-find ${FTPDIR} -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${SSHDIR} -- "{}" +
-for defdir in {0..15}; do
-    find ${FTPDIR}/DELAYED/${defdir}-day -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${SSHDIR}/DELAYED/${defdir}-day -- "{}" +
+# the TARGETDIR)
+for sourcedir in ${TOPROCESS}; do
+    find ${sourcedir} -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${TARGETDIR} -- "{}" +
+    for defdir in {0..15}; do
+        find ${sourcedir}/DELAYED/${defdir}-day -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${TARGETDIR}/DELAYED/${defdir}-day -- "{}" +
+    done
 done
 
-# If we are the master host, we have a little extrawork to do, collect all
+# If we are the master host, we have a little extra work to do, collect all
 # files from other queue hosts.
 if [[ ${HOST} == usper ]]; then
     # And now fetch all files from the queue hosts
-- 
2.1.4


Reply to: