X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by lists.alpinelinux.org (Postfix) with ESMTP id A982A1EC816 for ; Tue, 23 Jun 2009 20:08:58 +0000 (UTC) Received: by qyk14 with SMTP id 14so481800qyk.27 for ; Tue, 23 Jun 2009 13:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=B2sJTTUo7zRrOtUDzPNiBAROTDR2o1W77pS8ViiUL0w=; b=XU9jb49/FEPThRX3qbWe1o9A5npdWEENFWTe29etwdviA5ReH+Vt0mes3TI2EMc0XF UVd/45EjQDuLnoRYpu28bboRHtmknLn6vZqetqC1JznVxeQp+bvF8zajIAaTlzzh+iUE MtuUVBR50Up3YwmYOsW8yGB70PyJXObJTz5EM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=DhDOECh81eMqIbp0SjwEpSI3v6qaHNYb55gSKO9gmGxFM3b3AqaI+MepqHaligJNFW pDg0UwLzsLbWPBC2zBQW6v6ipTN1DsE51JTHnpqLmV9VBdNLOTjLZUcZbOUZd/BdK9c7 4pTMWKRtIsFOAfIZKRBFIaqY5H6qkgt48pAxk= Received: by 10.224.73.142 with SMTP id q14mr527712qaj.290.1245787734520; Tue, 23 Jun 2009 13:08:54 -0700 (PDT) Received: from whopper.cde.wtbts.net ([208.74.141.254]) by mx.google.com with ESMTPS id 26sm538224qwa.27.2009.06.23.13.08.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Jun 2009 13:08:53 -0700 (PDT) Message-Id: From: Michael Mason To: Alpine-devel Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 (Apple Message framework v935.3) Subject: [alpine-devel] Bug in sysklogd daily rotate Date: Tue, 23 Jun 2009 20:08:51 +0000 X-Mailer: Apple Mail (2.935.3) Hello, Ran into a bug with the /etc/periodic/daily/sysklogd script on the latest version of alpine 1.8. We needed to keep log files for more 32 days and that is why we ran into the bug. The bug will occur when changing the cycle to more than 9 days. --- sysklogd Tue Jun 23 20:03:24 2009 +++ mine Tue Jun 23 20:03:39 2009 @@ -50,15 +50,16 @@ logfile=$1 # Cycle the logs - while [ $cycle -ne 0 ]; do + while [ $cycle -ne 1 ]; do p=$cycle cycle=$(( $cycle - 1 )) - a=$logfile.$cycle* + a=$logfile.$cycle.* b=$( echo $a | sed "s/\.$cycle/\.$p/") [ -f $a ] && mv $a $b done # compress .1 and let .0 be uncompressed + [ -f $logfile.0 ] && mv $logfile.0 $logfile.1 [ -f $logfile.1 ] && gzip $logfile.1 [ -f $logfile ] && mv $logfile $logfile.0 I didn't know who might be interested in this and didn't see sysklogd in 1.9 so passing it onto the list. Thanks nangel for pointing this out. --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---