From owner-freebsd-questions@FreeBSD.ORG Wed Oct 1 23:52:57 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B803F106568C for ; Wed, 1 Oct 2008 23:52:57 +0000 (UTC) (envelope-from gpeel@thenetnow.com) Received: from thenetnow.com (thenetnow.com [69.90.69.141]) by mx1.freebsd.org (Postfix) with ESMTP id 92BF38FC0C for ; Wed, 1 Oct 2008 23:52:57 +0000 (UTC) (envelope-from gpeel@thenetnow.com) Received: from hpeel.ody.ca ([216.240.12.2] helo=GRANT) by constellation.thenetnow.com with esmtpa (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KlBV2-000P00-Iu for freebsd-questions@freebsd.org; Wed, 01 Oct 2008 19:52:56 -0400 Message-ID: <668A2B1DDBEC40BCAC6A82589B5D1159@GRANT> From: "Grant Peel" To: Date: Wed, 1 Oct 2008 19:52:48 -0400 Organization: The Net Now MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Subject: Logrotate X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Grant Peel List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2008 23:52:57 -0000 Hi all, I have recently started using logrotate to rotate all the logs in the users home directories. These are all apache logs files. /home/domain.com/logsaccess_log /home/domain.com/logsaccess_log.0.gz /home/domain.com/logsaccess_log.1.gz /home/domain.com/logsaccess_log.2.gz I have a problem though. Some of my domains have softlinks pointing to them, this causes the logs to be rotated 2 or more times (i.e. 1 time for the 'real' directory, and 1 time each for each softlink pointing to them). Example /home/domain.com/logs/ domain2.com -> domain.com domain3.com -> domain.com will result in the 'access_log' being rotated 3 times in one run, causing my log dirs to look like this: -rw-r--r-- 1 root holt 160 Oct 1 05:44 access_log -rw-r--r-- 1 root holt 446 Oct 1 05:44 error_log -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.1.gz -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.2.gz -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.3.gz -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.4.gz -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.5.gz -rw-r--r-- 1 root holt 20 Oct 1 03:46 access_log.6.gz -rw-r--r-- 1 root holt 224 Oct 1 03:46 access_log.7.gz -rw-r--r-- 1 root holt 20 Sep 30 03:46 access_log.8.gz -rw-r--r-- 1 root holt 20 Sep 30 03:46 access_log.9.gz Here is this appropriate part of my logrotate.conf # logrotate.conf compress ... /home/*/logs/access_log { missingok rotate 14 daily create 644 root sharedscripts postrotate /usr/local/sbin/apachectl restart endscript } # End of logrotate.conf Question, is there a way to stop this from happening? -Grant