Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default Domlog Rotation

    Is there a particular time or particular process that is responsible for emptying the Apache domlogs at the end of each month?

    I've never been able to find out specifically when this process runs. It always seems to be near the end of the month, but never an exact time.

    Is there a process that does this emptying? Is there a pre-hook for this process?

    I am wanting to back up some of the domlogs before they are emptied out and I'm just wondering if there is a way to get this to run just before the domlogs are emptied.

  2. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    This is handled by the cpanellogd process. There are some tweak settings that change how the logs are handled. Do either of these address your concerns:

    Delete each domain's access logs after stats run

    Keep log files at the end of the month (default is off as you can run out of disk space quickly)


    To my knowledge there is no way to hook into this process.
    Kenneth
    Product Manager
    cPanel, Inc.

  3. #3
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    I think you might be able to change the file /usr/local/cpanel/Cpanel/Logd.pm and add something like:

    Code:
    if (-x "/scripts/prelogrotate") {
    	system("/scripts/prelogrotate", $log);
    }
    before the resetfile($log) call.

    This would allow administrators to create their own /scripts/prelogrotate where they could back up $log as they see fit, if they wanted to keep the previous month's logs in another location.

    See the attached patch file.
    Attached Files

  4. #4
    Registered User
    Join Date
    Oct 2009
    Posts
    1

    Default

    Any idea on what the rotation frequency is dependent on? It doesn't seem to be a fixed time, from my experience. Is it based on size of the access log or some other parameters?

Similar Threads & Tags
Similar threads

  1. domlog rotation problem.
    By Dmitry M. in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-03-2006, 01:40 AM
  2. DomLog rotation?
    By Ronny in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 09-01-2005, 10:11 AM
  3. domlog rotation: The Definitive Answer?
    By payne in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 11-23-2003, 07:33 AM
  4. Domlog Help
    By MySitesOnline in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-22-2003, 06:40 AM
  5. Domlog rotation and Webalizer Stats
    By maverick in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-03-2003, 03:42 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube