]> mj.ucw.cz Git - eval.git/blob - mop/admin/mo-back-grab.sh
Need to switch directory when reading configuration.
[eval.git] / mop / admin / mo-back-grab.sh
1 #!/bin/sh
2 # Find all submits in the local copy of contestants' home directories
3 # (as created by mo-backup) and copy them to solutions/.
4
5 if [ -z "$1" ] ; then
6         echo "Directory name expected"
7         exit 1
8 fi
9 rm -rf solutions/mo*
10 for m in `cd $1 ; echo *` ; do
11         echo -n "$m:"
12         for d in $1/$m/mo??/mo?? ; do
13                 u=`basename $d`
14                 if [ $u != mo00 -a -d $d/.submit ] ; then
15                         echo -n " $u"
16                         if [ -d solutions/$u ] ; then
17                                 echo -n "<DUP!!!>"
18                         else
19                                 cp -a $d/.submit solutions/$u
20                         fi
21                 fi
22         done
23         echo
24 done