From 0f7252ed9159f871f263dbea0b0d9ae2cfb0bec4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 25 May 2008 23:06:23 +0200 Subject: [PATCH] Clean up backup, grab and push scripts. --- mop/admin/mo-back-grab.sh | 3 +++ mop/admin/mo-back-status.sh | 3 +++ mop/admin/mo-backup.sh | 2 ++ mop/admin/mo-grab-remote.sh | 1 + mop/admin/mo-grab.sh | 2 ++ mop/admin/mo-push-certs.sh | 11 +++++++---- mop/admin/mo-push-feedback.sh | 9 +++++++-- 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/mop/admin/mo-back-grab.sh b/mop/admin/mo-back-grab.sh index 5628034..5fa7181 100755 --- a/mop/admin/mo-back-grab.sh +++ b/mop/admin/mo-back-grab.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Find all submits in the local copy of contestants' home directories +# (as created by mo-backup) and copy them to solutions/. + if [ -z "$1" ] ; then echo "Directory name expected" exit 1 diff --git a/mop/admin/mo-back-status.sh b/mop/admin/mo-back-status.sh index e3eecc6..1a51fb5 100755 --- a/mop/admin/mo-back-status.sh +++ b/mop/admin/mo-back-status.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Find all submits in the local copy of contestants' home directories +# (as created by mo-backup) and print their status. + if [ -z "$1" ] ; then echo "Directory name expected" exit 1 diff --git a/mop/admin/mo-backup.sh b/mop/admin/mo-backup.sh index 00b13f8..834ca9a 100755 --- a/mop/admin/mo-backup.sh +++ b/mop/admin/mo-backup.sh @@ -1,4 +1,6 @@ #!/bin/sh +# A trivial script to back up contestants' home directories. + if [ -z "$1" ] ; then D=back/`date '+%H%M'` else diff --git a/mop/admin/mo-grab-remote.sh b/mop/admin/mo-grab-remote.sh index 6181b4e..eff0ec0 100755 --- a/mop/admin/mo-grab-remote.sh +++ b/mop/admin/mo-grab-remote.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Grab all submits from the submit server and copy them to solutions/. [ -n "$1" ] || { echo "Usage: mo-grab-remote " ; exit 1 ; } [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; } diff --git a/mop/admin/mo-grab.sh b/mop/admin/mo-grab.sh index 9ce2f19..ad57520 100755 --- a/mop/admin/mo-grab.sh +++ b/mop/admin/mo-grab.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Grab all submits from contestants' home directories located on the +# local machine and copy them to solutions/. [ -n "$1" ] || { echo "Usage: mo-grab " ; exit 1 ; } [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; } diff --git a/mop/admin/mo-push-certs.sh b/mop/admin/mo-push-certs.sh index 54b84ba..55a3fd3 100755 --- a/mop/admin/mo-push-certs.sh +++ b/mop/admin/mo-push-certs.sh @@ -1,12 +1,15 @@ #!/bin/bash -[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; } +# Copy submit certificates to contestants' machines. Each machine gets +# only the certs of the contestants who should use it. + +[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } set -e -. config +. cf/mop while IFS=" " read LOGIN FULL MACH ; do if [ -z "$1" -o "$1" == "$LOGIN" ] ; then echo "$LOGIN -> $MACH" - D=/mo/users/$LOGIN/$LOGIN/ + D=$MO_ROOT/users/$LOGIN/$LOGIN/ rsync -av $D/.mo root@$MACH:$D/ fi $MACH" - D=/mo/users/$LOGIN/$LOGIN/ + D=$MO_ROOT/users/$LOGIN/$LOGIN/ rsync -av ~mo-eval/testing/$LOGIN root@$MACH:$D/results ssh root@$MACH "cd $D && chown -R $LOGIN.$LOGIN results" fi