Current time: 11-23-2024, 12:15 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to deal with log storage/rotation
Author Message
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #6
RE: How to deal with log storage/rotation
(05-31-2011 06:23 AM)kilburn Wrote:  I'm okay with a script-based solution to archive the log files (I would create a folder for each day).

If you are going to do it, take into account that log removal also has to be taken care of by the archival (or another) script, since logrotate will not find the logs anymore once archived.
Ok, I created a new script based on ispcp-del-logs.sh and some snipped that kilburn sent to me.
I've been testing it on my test machine and works fine to archive the logs from apache users. It archives the logs in archive/YYYYMM/
It tries to guess the logs date from the name (20110606 would mean june 2011), if it doesn't find the name archives the logs to the current month folder.
The maximum number of files that there will be on a folder will be 31 per domain, but it it doesn't need rotation there will be less files.
I attach the script, please have a look and comment what you think.


Attached File(s)
.txt  ispcp-archive-logs.sh.txt (Size: 2.15 KB / Downloads: 8)
06-10-2011 12:01 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to deal with log storage/rotation - aseques - 06-10-2011 12:01 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)