2018-01-19 14:20:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script synchronizes first, the generated frontend and then
|
|
|
|
# retrieves submissions
|
|
|
|
|
|
|
|
BASEDIR="/srv"
|
|
|
|
FRONTEND_HOSTNAME="deimos"
|
|
|
|
|
|
|
|
SSH_OPTS="/usr/bin/ssh -p 22 -i ~/.ssh/id_ed25519 -o ControlMaster=auto -o ControlPath=/root/.ssh/%r@%h:%p -o ControlPersist=2 -o PasswordAuthentication=no -o StrictHostKeyChecking=no"
|
|
|
|
|
|
|
|
cd "${BASEDIR}"
|
|
|
|
|
|
|
|
# Synchronize CA
|
|
|
|
rsync -e "$SSH_OPTS" -av --delete PKI/shared "${FRONTEND_HOSTNAME}":"${BASEDIR}"/PKI
|
|
|
|
|
|
|
|
I=0
|
|
|
|
|
|
|
|
touch /tmp/stop
|
|
|
|
while ! [ -f SETTINGS/stop ] || [ /tmp/stop -nt SETTINGS/stop ]
|
|
|
|
do
|
|
|
|
# Synchronize static files pages
|
2018-12-08 19:13:48 +00:00
|
|
|
rsync -e "$SSH_OPTS" -av --delete --links TEAMS SETTINGS FILES "${FRONTEND_HOSTNAME}":"${BASEDIR}"
|
2018-01-19 14:20:39 +00:00
|
|
|
|
|
|
|
# Synchronize submissions
|
2018-12-08 19:13:48 +00:00
|
|
|
rsync -e "$SSH_OPTS" -av --links --delay-updates --temp-dir=.tmp/ --partial-dir=.tmp/ --remove-source-files "${FRONTEND_HOSTNAME}":"${BASEDIR}"/submissions/ submissions/
|
2018-01-19 14:20:39 +00:00
|
|
|
|
|
|
|
sleep 0.3
|
|
|
|
done
|
|
|
|
|
|
|
|
echo See you
|