Many user cron log files

Discussion in 'ISPConfig 3 Priority Support' started by atle, May 7, 2021.

  1. atle

    atle Member HowtoForge Supporter

    There seems to be 4 user cron log files rotated in folder private every night, where three of them are empty:

    [​IMG]

    How is this managed?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You do not bother to mention what operating system is involved. What directory exactly? So hard to say.
    My guess is it is logrotate that makes those gzipped logfiles, read man logrotate
    It should make only one copy per day, so it is indeed strange to have 4. Perhaps logrotate is somehow started four times, when it should only run once.
     
  3. atle

    atle Member HowtoForge Supporter

    Well, I did bother. The signature says Debian. The text said "folder private".
    This is logrotate of the users cron files, that resides in their private directory. I don't believe they are managed by logrotate, but have not checked that.
    This user has 4 cron jobs, I supspect there could be a bug.
     
    Last edited: May 8, 2021
  4. atle

    atle Member HowtoForge Supporter

    No, I can't see they are managed by logrotate, as I originally did not believe as well, hence I asked here.
     
  5. atle

    atle Member HowtoForge Supporter

    It seems server/lib/classes/cron.d/200-logfiles.inc.php manages the rotation.
     
  6. atle

    atle Member HowtoForge Supporter

    The only thing I found so far, this sql statement
    Code:
    $sql = "SELECT domain_id, domain, type, document_root, web_folder, parent_domain_id, log_retention FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain
    ' or type = 'vhostalias') AND server_id = ?";
    will return the same document_root several times if there are vhostaliases and/or vhostsubdomains, and hence rotation of

    Code:
                         
    $cron_logfiles = array('cron.log', 'cron_error.log', 'cron_wget.log');
    foreach($cron_logfiles as $cron_logfile) {
        $cron_logfile = $rec['document_root'].'/private/' . $cron_logfile;
       // rename older files (move up by one)
      .
      .
    
    will be done several times.

    However, this is not the case for me, my example does only have one vhost, nothing else, hence it does not explain the multiple log rotations for me.

    Guess I will have to put in some debug code and see what happens during the nights.
     
    Last edited: May 9, 2021
  7. atle

    atle Member HowtoForge Supporter

    Hm, it turned out this is the bug that causes multiple log rotations for me. My domain did have three "vhostsubdomain" on top of the "vhost", that is four and hence the cron files have been rotated four times.
    Thanks for your time and attention :)
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes, every single one of them can have a cronjob, so that's the reason ;)
     
  9. atle

    atle Member HowtoForge Supporter

    Yes, sure, but they use the same log files. I don't understand what you are aiming for here.
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

Share This Page