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
+}
###
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"