If you wanna keep older logs and they are not compressed — like on many Ubuntu 8.04 — you can run this script.
I just call it from cron, every 2nd of the month and save the output in a logfile.
Code:
#!/bin/sh
# Compressing all log files in User Web
# Script takes Month as parameter
# like: ./compressLogs.sh 01
for i in `find /var/www/web*/log/20*/$1/*.log`
do
echo "
"
echo "Filesize: " `du -h $i`
echo "Compressing File..."
gzip $i
newFile=$i.gz
echo "New Filesize: " `du -h $newFile`
echo "__________________________________________________________________________"
done
Adjust it to YOUR needs!
Cheers
Recent comments
17 hours 6 min ago
23 hours 48 min ago
1 day 3 hours ago
1 day 5 hours ago
1 day 13 hours ago
1 day 23 hours ago
2 days 14 sec ago
2 days 3 hours ago
2 days 7 hours ago
2 days 8 hours ago