[dak/master] Usper now collects files from all upload queue hosts
No more debianqueued on them.
---
config/homedir/ssh/usper-config | 19 +++++++++++++++++++
scripts/debian/moveftp.sh | 21 +++++++++++++++------
2 files changed, 34 insertions(+), 6 deletions(-)
create mode 100644 config/homedir/ssh/usper-config
diff --git a/config/homedir/ssh/usper-config b/config/homedir/ssh/usper-config
new file mode 100644
index 0000000..285cbe5
--- /dev/null
+++ b/config/homedir/ssh/usper-config
@@ -0,0 +1,19 @@
+# Please edit the master copy in dak.git!
+# path: config/homedir/ssh/usper-config
+
+Protocol 2
+ConnectTimeout 30
+ServerAliveInterval 30
+ForwardX11 no
+ForwardAgent no
+StrictHostKeyChecking yes
+PasswordAuthentication no
+BatchMode yes
+ControlMaster auto
+ControlPath ~/.ssh-pipe_%n
+ControlPersist yes
+
+Host queue-coccia
+ Hostname coccia.debian.org
+ User dak
+ IdentityFile /srv/ftp-master.debian.org/s3kr1t/ssh/sync_queuedirs
diff --git a/scripts/debian/moveftp.sh b/scripts/debian/moveftp.sh
index b1cd3b0..e0e8662 100755
--- a/scripts/debian/moveftp.sh
+++ b/scripts/debian/moveftp.sh
@@ -3,15 +3,24 @@
set -e
set -u
+QUEUEHOSTS="queue-coccia"
FTPDIR="/srv/upload.debian.org/ftp/pub/UploadQueue/"
SSHDIR="/srv/upload.debian.org/UploadQueue/"
HOST=$(hostname -s)
-if [[ ${HOST} == coccia ]]; then
- find ${FTPDIR} -type f -mmin +15 -print0 -exec mv --no-clobber --target-directory=${SSHDIR} -- "{}" +
-elif [[ ${HOST} == usper ]]; then
- find ${FTPDIR} -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${SSHDIR} -- "{}" +
- for defdir in {1..15}; do
- find ${FTPDIR}/DELAYED/${defdir}-day -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${SSHDIR}/DELAYED/${defdir}-day -- "{}" +
+# 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 {1..15}; do
+ find ${FTPDIR}/DELAYED/${defdir}-day -maxdepth 1 -type f -mmin +5 -print0 -exec mv --no-clobber --target-directory=${SSHDIR}/DELAYED/${defdir}-day -- "{}" +
+done
+
+# If we are the master host, we have a little extrawork to do, collect all
+# files from other queue hosts.
+if [[ ${HOST} == usper ]]; then
+ # And now fetch all files from the queue hosts
+ cd ${SSHDIR}
+ for host in ${QUEUEHOSTS}; do
+ rsync -aOq --ignore-existing --remove-source-files -e 'ssh -F /srv/ftp-master.debian.org/dak/config/homedir/ssh/usper-config' ${host}:/does/not/matter . || true
done
fi
--
2.1.4
Reply to: