
12th July 2006, 15:00
|
|
Member
|
|
Join Date: Aug 2005
Posts: 85
Thanks: 1
Thanked 6 Times in 5 Posts
|
|
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)
|

12th July 2006, 16:43
|
|
Senior Member
|
|
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
|
|
mmm are this logs files usefull for something? if after the zip every is ok, i prefer to delete them...
|

12th July 2006, 19:10
|
|
Senior Member
|
|
Join Date: Dec 2005
Posts: 213
Thanks: 1
Thanked 7 Times in 5 Posts
|
|
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
|

12th July 2006, 19:37
|
|
Senior Member
|
|
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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..
|

12th July 2006, 20:07
|
|
Member
|
|
Join Date: Aug 2005
Posts: 85
Thanks: 1
Thanked 6 Times in 5 Posts
|
|
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.
|

12th July 2006, 22:06
|
|
Senior Member
|
|
Join Date: Dec 2005
Posts: 213
Thanks: 1
Thanked 7 Times in 5 Posts
|
|
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..
|

13th July 2006, 15:26
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
|
|
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.
|

13th July 2006, 15:51
|
|
Senior Member
|
|
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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?
|

14th July 2006, 11:07
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 19,805
Thanks: 285
Thanked 1,805 Times in 1,357 Posts
|
|
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
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 10:18.
|
Recent comments
1 day 1 hour ago
1 day 7 hours ago
1 day 7 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 10 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 13 hours ago
1 day 14 hours ago