Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th July 2006, 14:00
todvard todvard is offline
Member
 
Join Date: Aug 2005
Posts: 85
Thanks: 1
Thanked 6 Times in 5 Posts
Default compressing web.log files

Hi all,

i have found that the old log files in webxx/log folders are too big, thats why i have created this bash script to compress those files.
The script is short (and ugly too, i know , but it's working ):

Code:
#!/bin/sh

for i in  `find /var/www/ -type f -mtime +2 -name web.log | grep -v "/\`date +%m\`/"` ; do gzip $i; done
Run it from cron every day, after ISPConfig's log.php script (which is running 0.30 AM every day in the default installation)
Reply With Quote
Sponsored Links
  #2  
Old 12th July 2006, 15:43
fobicodam fobicodam is offline
Senior Member
 
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to fobicodam
Default

mmm are this logs files usefull for something? if after the zip every is ok, i prefer to delete them...
Reply With Quote
  #3  
Old 12th July 2006, 18:10
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 215
Thanks: 1
Thanked 7 Times in 5 Posts
Default

Quote:
Originally Posted by fobicodam
mmm are this logs files usefull for something? if after the zip every is ok, i prefer to delete them...
Site gets hacked while you are away for 2 days, you can check logs if you still have them.. So yeah, they can be usefull
Reply With Quote
  #4  
Old 12th July 2006, 18:37
fobicodam fobicodam is offline
Senior Member
 
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to fobicodam
Default

mmm Site has been hacked, im away two days... should i check a 2 Gb text file to see whats modified or should i restore a backup?... my choice is a backup..
Reply With Quote
  #5  
Old 12th July 2006, 19:07
todvard todvard is offline
Member
 
Join Date: Aug 2005
Posts: 85
Thanks: 1
Thanked 6 Times in 5 Posts
Smile

If you want to avoid to be hacked for second time, then yes, you should check those 2GB text files anyway, it is up to you.
Reply With Quote
  #6  
Old 12th July 2006, 21:06
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 215
Thanks: 1
Thanked 7 Times in 5 Posts
Default

What todvard said.. but it is indeed decision made by you, if you use backup thinking that bug will be resolved by itself then fine by me..
Reply With Quote
  #7  
Old 13th July 2006, 14:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Quote:
Originally Posted by fobicodam
mmm are this logs files usefull for something? if after the zip every is ok, i prefer to delete them...
There's also a legal reason: in some countries you must keep log files for at least a few months if you provide hosting services.
__________________
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
  #8  
Old 13th July 2006, 14:51
fobicodam fobicodam is offline
Senior Member
 
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to fobicodam
Default

Im lucky its not here.. but anyway, my big problem is the 2Gb limit for files. Can i somehos change the script to not append everyday log file to the bi main file? i mean, save daily log in separate files?
Reply With Quote
  #9  
Old 14th July 2006, 10:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
 
Default

If you split the log in daily files, you might get problems with the webalizer stats generation.

You can try this by modifying the script /root/ispconfig/scripts/shell/logs.php
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
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
How to keep in RAM a number of text files? calande Server Operation 2 7th January 2008 17:17
Big client log files Jorem Installation/Configuration 2 13th November 2007 09:52
ispconfig + typo3 + and files not visible in ispconfig blackflag General 4 19th February 2006 14:06
SSH, users from web1 can read files from web2, web3, web4 ecorona Installation/Configuration 3 1st February 2006 20:48
Webalizer tab files matheron Server Operation 4 11th December 2005 13:26


All times are GMT +2. The time now is 22:56.


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