]> mj.ucw.cz Git - eval.git/blob - mop/admin/mo-grab-remote.sh
Merge branch 'container'
[eval.git] / mop / admin / mo-grab-remote.sh
1 #!/bin/bash
2 # Grab all submits from the submit server and copy them to solutions/.
3
4 [ -n "$1" ] || { echo "Usage: mo-grab-remote <tasks>" ; exit 1 ; }
5 [ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; }
6 set -e
7 . cf/mop
8
9 rsync -a --delete mo-submit@mo100:solutions/ submits
10 for user in `bin/mo-get-users` ; do
11         echo -n "$user:"
12         mkdir -p solutions/$user
13         for t in $@ ; do
14                 rm -rf solutions/$user/$t
15                 D=submits/$user/$t
16                 if [ -d $D ] ; then
17                         echo -n " $t"
18                         cp -a $D solutions/$user/$t
19                 fi
20         done
21         echo
22 done