Article ID: 117160, created on Sep 6, 2013, last review on May 10, 2014

  • Applies to:
  • H-Sphere 3.6.2

Symptoms

FTP log files are not rotating on any of the servers.

Cause

The problem is related to cron job /hsphere/shared/scripts/cron/ftp_anlz_user.pl that removes file /hsphere/local/var/proftpd/xferlog.

Resolution

  1. Create the script /hsphere/shared/scripts/cron/cron_save_xferlog.sh with following content:

    #!/bin/bash
    cp /hsphere/local/var/proftpd/xferlog /hsphere/local/var/proftpd/xferlog.saved
    

    Make the script executable:

    chmod +x /hsphere/shared/scripts/cron/cron_save_xferlog.sh
    
  2. Create new cron task, which is going to be executed right before ftp_anlz_user.pl:

    59 3 * * * nice -15 /hsphere/shared/scripts/cron/cron_save_xferlog.sh
    
  3. Modify the file /etc/logrotate.d/hsphere-ftp and add /hsphere/local/var/proftpd/xferlog.saved to the list of the file to which log rotation rules apply:

    /hsphere/local/var/proftpd/auth.log /hsphere/local/var/proftpd/paranoid.log /hsphere/local/var/proftpd/tls.log /hsphere/local/var/proftpd/gssftp.log /hsphere/local/var/proftpd/xferlog.saved{
        daily
        rotate 8
        missingok
        compress
        delaycompress
        postrotate
          /command/svc -h /service/proftpd
        endscript
    }
    

Search Words

ftp logs are not rotating correctly

e5eac925e853cc7ef3f6055683c98fbb 6311ae17c1ee52b36e68aaf4ad066387 f213b9fa8759d57bee5d547445806fe7 2e39a5e5b1423cc126cf735bac076008

Email subscription for changes to this article
Save as PDF