Domain apache log rotation.

tdldp

Verified User
Joined
May 9, 2005
Messages
150
Hi all...

Long time no see, but i'm back due to a problem i have with logs for our DA server.

Let me explain problems faced :

- Until a 1.3x update (i dont remember which), tally was working correctly, and suddenly stopped as DA cron tally command had gotten commented out. I was then facing end of month disk size problems, as files could grow up in /var/logs, to several MB (biggest file was 600 Mb large).

- I set back up tally rotation, which since then works fine, but i have no more monthly history on logs, that i used to have on my old fedora server (under 1.2x versions) and this is a bit worrying, for the reason that follows

- I have had a client who got robbed, and police authority think that robbers made their shopping through the clients website before doing their act.
French authority, asked us to provide 6 weeks site access logs, and i was in the incapacity to provide asked logs... Indeed tally rotation keeps for domains only 30 last days logs, and no other logs, and i could therefore only provide 4 weeks logs.. We face problems on this as french laws are even worse: The ask every hosting provider to keep 1 year log history for every website hosted, for any authority service demand. In result police warned us of our obligation to store one year log history, otherwise we could face justice problems, on demands of french authority...

So my needs are the following, and i'd like DA worked on following scheme so that we can respect french law enforcement :

- /var/log/httpd tally work on a daily scheme so that /var/log/httpd does not grow larger than a few GB. (that works already)

- Log rotation work on a domain basis, and most of all that log rotation increments in a /home/user/logs a monthly log tar.gz, that gets rotated 12 times (so that we always keep 12 months of logs,) plus the usual x times (admin defined) rotated logs that are done in the tally process. (that needs to be worked out so that french DA users respect national laws)

Any help to solve this is welcomed...
 
Hmm, interesting problem...
(Kinda need a solution to this as well...)

Normally I'd just setup something in logrotate.d, however it seems DA does log rotation internally, aka, I am unable to find something responsible for rotating the logs.

Wouldn't it be smarter in this case to use a bash script that runs like say every week?
In semicode something like:
Code:
#!/bin/bash
echo "THIS IS SEMICODE, IT WILL NOT WORK WITHOUT MODIFICATIONS"
cd /home
for i in `ls`;
do
if [ -d "/home/$i/domains"];
then
cd /home/$i/domains
for domains in `ls`;
do
cp -v #something to get the right file# /NAS/LOGS/$domains/#Todays date#.tar.gz
done
fi
done

The above code won't work, but might help...
 
Back
Top