Archive domlogs when rotating them instead of deleting them… is there a hook to do this ?

monarobase

Well-Known Member
PartnerNOC
Jan 26, 2010
512
3
68
France
cPanel Access Level
Root Administrator
Hello,

We have a legal requirement to keep a backup of logs for 365 days and I'm trying to set up a rotation system that would prevent logs from being lossed and without loosing any lines or filling up all the usr partition.

When cPanel updates the stats with /scripts/runweblogs it creates a tempory file, runs the stats on it, then deletes it.

Is there a hook or some way I can get a copy of the log tempory file before it's deleted ?

At the moment I update the stats with a script I run daily with cron, running /scripts/runweblogs username for each user once I've backed up his logs. I'm looking to improve this method so I don't loose any log entries in between backing up and running /scripts/runweblogs

Do you have an idea of how I could get this done ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello :)

There are several options that may interest you under the "Stats and Logs" tab in "WHM Home » Server Configuration » Tweak Settings". In particular, these two options are relevant:

"Delete each domain’s access logs after stats run"
"Keep monthly log files"

Thank you.
 
Thread starter Similar threads Forum Replies Date
E Developer Experience 1
S Developer Experience 0