turn off f24 build
[infrastructure.git] / scripts / dump-db-svn.sh
index d3f43ee..0c3c368 100755 (executable)
@@ -13,14 +13,38 @@ LOGDIR=$DATADIR/aa-dumplog
 LOG=$LOGDIR/${DATE}.log
 LATESTLOG=latest.log
 
-REVISION="$Revision$"
-
-source $COMMANDDIR/functions.sh
+### create a symlink in same dir
+# arguments 
+# actual : full path of the actual file
+# link : the link name, only basename is used, will be created in same dir
+function manage_link () {
+    actual=$1; shift
+    latest=$1; shift
+    # go in the right directory
+    cd $(dirname $actual)
+    actualbase=$(basename $actual)
+    # just in case 
+    latest=$(basename $latest)
+    echo "In $(pwd) : linking $actualbase to $latest"
+    rm -f $latest ; ln -s $actualbase $latest
+    # go back to current dir
+    cd -
+}
+    
+# usage
+# clean <where> <keeptime> [... find arguments]
+function clean () {
+    where=$1; shift
+    keeptime=$1; shift
+    echo "== In $where"
+    echo "Cleaning $@ - older than $keeptime days"
+    find $where "$@" -atime +$keeptime | xargs rm 
+}
 
 ###
 
 case $(hostname) in
-  *build*|*kruder*)
+  *build*|*kruder*|*blitz*)
     DEFAULTS="subversion" ;;
   *plc*|*private*)
     DEFAULTS="planetlab4" ;;
@@ -37,7 +61,7 @@ SUBVERSION_KEEPTIME=7
 SUBVERSION_REPO=/svn
 
 function usage () {
-    echo "This is $COMMAND, $REVISION"
+    echo "This is $COMMAND"
     echo "Usage: $COMMAND [subversion]"
     echo -e "\tkeyword 'subversion' : $SUBVERSION_REPO/ is dumped"
 #    echo -e "\tkeyword 'apache' : $APACHE_ROOT/ is tared"