Commit 1823465f authored by Lionel Gauthier's avatar Lionel Gauthier

added rotate_log

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5099 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent aad33d35
...@@ -316,6 +316,17 @@ check_for_root_rights() { ...@@ -316,6 +316,17 @@ check_for_root_rights() {
fi fi
} }
rotate_log_file () {
if [ -f $1 ]; then
TIMESTAMP=`date +%Y-%m-%d.%Hh_%Mm_%Ss`
NEWLOGFILE=$1.$TIMESTAMP
mv $1 $NEWLOGFILE
cat /dev/null > $1
sync
nohup gzip -f -9 $NEWLOGFILE &
fi
}
########################################################### ###########################################################
declare -x OPENAIR_DIR="" declare -x OPENAIR_DIR=""
declare -x OPENAIR_HOME="" declare -x OPENAIR_HOME=""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment