The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'cPanel Developers' started by monarobase, Jun 17, 2013.

  1. monarobase

    monarobase Well-Known Member

    Jan 26, 2010
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    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 ?
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    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.

Share This Page