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, 15: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
  #2  
Old 12th July 2006, 16: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, 19:10
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 213
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, 19: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, 20: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, 22:06
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 213
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, 15:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 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
--
Follow me on:
Reply With Quote
  #8  
Old 13th July 2006, 15: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, 11:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 19,805
Thanks: 285
Thanked 1,805 Times in 1,357 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
--
http://www.projektfarm.com/en/
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 18:17
Big client log files Jorem Installation/Configuration 2 13th November 2007 10:52
ispconfig + typo3 + and files not visible in ispconfig blackflag General 4 19th February 2006 15:06
SSH, users from web1 can read files from web2, web3, web4 ecorona Installation/Configuration 3 1st February 2006 21:48
Webalizer tab files matheron Server Operation 4 11th December 2005 14:26


All times are GMT +2. The time now is 10:18.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions
Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com

Red Hat Virtual Experience - a free virtual event. Dec. 9th