#!/bin/bash
domlogpath=/usr/local/apache/domlogs
domloglines=5000
for name in `ls $domlogpath`
do
tail -n $domloglines $domlogpath/$name > /tmp/domlog.temp
cp -f /tmp/domlog.temp $domlogpath/$name
done
rm -f /tmp/domlog.temp
/bin/sleep 3
/usr/bin/killall -9 httpd
/bin/rm -rf /usr/local/apache/logs/*
/bin/sleep 5
/etc/rc.d/init.d/httpd startssl
========================================================
Go to "/" partition on server create a bash file for trimdomlogstrimdomlogs should be root.root and 755and copy above contents in taht file save and run it like
./trimdomlogs
It will delete all extra domlogs and will make space on server.
No comments:
Post a Comment