]> mj.ucw.cz Git - moe.git/commitdiff
Added backup tools from MO 2002/3.
authorMartin Mares <mj@ucw.cz>
Fri, 11 Apr 2003 09:52:27 +0000 (09:52 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 11 Apr 2003 09:52:27 +0000 (09:52 +0000)
bin/mo-back-grab [new file with mode: 0755]
bin/mo-back-status [new file with mode: 0755]
bin/mo-backup [new file with mode: 0755]

diff --git a/bin/mo-back-grab b/bin/mo-back-grab
new file mode 100755 (executable)
index 0000000..5628034
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+if [ -z "$1" ] ; then
+       echo "Directory name expected"
+       exit 1
+fi
+rm -rf solutions/mo*
+for m in `cd $1 ; echo *` ; do
+       echo -n "$m:"
+       for d in $1/$m/mo??/mo?? ; do
+               u=`basename $d`
+               if [ $u != mo00 -a -d $d/.submit ] ; then
+                       echo -n " $u"
+                       if [ -d solutions/$u ] ; then
+                               echo -n "<DUP!!!>"
+                       else
+                               cp -a $d/.submit solutions/$u
+                       fi
+               fi
+       done
+       echo
+done
diff --git a/bin/mo-back-status b/bin/mo-back-status
new file mode 100755 (executable)
index 0000000..bbc63dd
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ -z "$1" ] ; then
+       echo "Directory name expected"
+       exit 1
+fi
+for m in `cd $1 ; echo *` ; do
+       echo -n "$m:"
+       for d in $1/$m/mo??/mo?? ; do
+               u=`basename $d`
+               if [ $u != mo00 -a `ls $d | wc -l` -gt 0 ] ; then
+                       echo -n " $u"
+               fi
+       done
+       echo
+done
diff --git a/bin/mo-backup b/bin/mo-backup
new file mode 100755 (executable)
index 0000000..89cd6f1
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+D=back/`date '+%H%M'`
+mkdir -p $D
+for m in hi1{01,02,03,04,05,06,07,08,09,10,11,12} hi2{01,02,03,04,05,06,07,08,09,10,11} hi4{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,18,19,20} ; do
+       echo -n "$m: "
+       mkdir $p $D/$m
+       pushd $D/$m >/dev/null
+       ssh $m 'cd /aux/mo/users ; tar czf - .' | tar xzf -
+       popd >/dev/null
+       du -s $D/$m | cut -f 1
+done