#1  
Old 22nd July 2011, 15:11
sygram sygram is offline
Senior Member
 
Join Date: Jan 2007
Posts: 101
Thanks: 10
Thanked 2 Times in 2 Posts
Default large log files

Hi there,

i have noticed that in few websites the log folder is 2.6G . Most of web.log files are larger than 250MB. Is there a way to limit the level of logging ? I believe this will effect stats right ? What is the common practice ?

Regards,

Leon
Reply With Quote
Sponsored Links
  #2  
Old 23rd July 2011, 12:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,732 Times in 2,569 Posts
Default

You can delete old, unused log files to free space.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
sygram (26th July 2011)
  #3  
Old 2nd August 2011, 17:32
make-fun make-fun is offline
Member
 
Join Date: Jan 2008
Posts: 92
Thanks: 8
Thanked 8 Times in 7 Posts
 
Default

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
Reply With Quote
The Following User Says Thank You to make-fun For This Useful Post:
falko (3rd August 2011)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not working emails (DNS and postfix problem?) shekiman Installation/Configuration 9 1st March 2011 16:25
Hacked server Captain Installation/Configuration 8 23rd December 2010 10:39
Apache wont serve my files anymore:( wotIsCmd Server Operation 2 17th July 2009 20:24
missing webalizer stats bolero Installation/Configuration 15 12th November 2008 16:28
slow download through webserver problem snewp Technical 14 9th May 2008 05:25


All times are GMT +2. The time now is 17:49.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.