Can not archive apache logs.

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
343
To keep last 180 days of apache logs, I set logs_to_keep=180 in directadmin.conf couple of months ago. And today I wanted to check if all are fine. And in logs folder if user home directoty, I see many, for example,
Code:
Mar-2013.tar.gz
Mar-2013.tar.gz.1
Mar-2013.tar.gz.2
Mar-2013.tar.gz.3
.....
Mar-2013.tar.gz.30
Mar-2013.tar.gz.31
....

It seems like, apache logs are being collected but when I open Mar-2013.tar.gz to see if all days are there, (.tar.gz.x can not be viewed in notepad), I only 1 or two days of months, instead of each days of months. So why not each days are not saved?

Thanks
 
Great thanks. I have to open each files one by one and combine them to be able to say "this is the whole month's log" ?

1. Do I have any control over creation of those files?
2. What is the logic of seperating different files and seperating them into small files?
3. Is there a relation with Webalizer? And what if I donot use Webalizer to have more control? (log rotation)
 
Last edited:
1. Do I have any control over creation of those files?
3. Is there a relation with Webalizer? And what if I donot use Webalizer to have more control? (log rotation)

Normally, one can disable log-rotate built-in directadmin and organize another, if it's needed.

Related: http://www.directadmin.com/features.php?id=507

2. What is the logic of seperating different files and seperating them into small files?

Clarify your thoughts please. I don't understand what you are talking about.
 
Thank you for your time. I mean for example, it is hard to find certain day within these files, have to open all files. And also it is time consuming to extract all file to seperate folders and combine them - extracted files have same name so need to combine them manually.
I think it is not possible to change file structure like naming, archiving to a better way? So I guess, disabling log rotation is not related with file structures of these log files?
 
To find a certain day is not a simple task sometimes, try to match day creator +/- 1 day with a date you looking for.

extracted files have same name so need to combine them manually

I've even written a script to mass-extract logs into a temp directory, when I need to do a big search through logs.

Though I don't find the current scheme of log-rotating very comfortable for myself (I've posted a feature request for changing it's structure), I still use it, and even got used to it. Anyway if you don't like, feel free to disable it (by setting rotation=0) and use your own rotator with your own naming and archiving structure. By the way logrotate in linux allows to run scripts before/after rotation, so you might want to use it.
 
In fact all I needed is to keep last 6 months and to be able to find any day within them. And yes those scripts are so helpful.
 
Back
Top