User:Skooli
ETTVd startscript modification
I modified my start.sh to dump old logfiles and clean up the working dir before starting ettvd. I "workarounded" it with linux cmds since i didnt want to install logrotate for that (and its just a few lines)
#!/bin/sh
# old logfile dumper
if [ -r nohup.out ]; then # only log if there exist old logfiles
if [ ! -d logs ]; then # if the logs/ directory does not exist...
mkdir logs # ...create it
echo "dumping files for the first time - created directory logs/"
fi
filename=`date "+%Y.%m.%d-%H.%M.%S"` # set the current date to the filename of the archive
tar cf logs/$filename.tar nohup.out *.log # tar it
gzip logs/$filename.tar # zip it
rm nohup.out *.log # delete old logs from working dir
echo "dumped old logfiles to logs/$filename.tar.gz"
echo " "
fi
# start ettvd
nice -n-4 su youruser -c "nohup php5 ettvd.php &"