From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BCC3759CA6 for ; Fri, 25 Mar 2016 20:34:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66A0E21C035; Fri, 25 Mar 2016 20:34:45 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 247D321C020 for ; Fri, 25 Mar 2016 20:34:43 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id p65so33883806wmp.0 for ; Fri, 25 Mar 2016 13:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=HGA4j2VSY6/N7k/ZZBSZ6LxcUM89cnL8/TELS3T2UzA=; b=cTPCep4Zay28m87h/wT8+4cjg2FcdYq/lRDsTIlc8ab+fCyX+SlXhveBe8D3kvhHhB EXnkebfcK6iRvNffc6vcdBvl+VWayjzg1lf9Ft/JH57I5jBXJv5uXQUvgkG+ieAFVlwS vEadNdF6yJk/WXcwd9J+5rOAnpse7o8BKF8GeroTazTbmonlHeAThl+DWoxX0gBfMS+P iQ7FLjox2XTP7rFh4Iqo96Li7dg66XoP5a69XmADC72o4rib0Fmpmqctjuq5aExB1RGU mG3lDS3Mdu9U/Mi1BfR2MIVeuhg0lPeHJfZmsSEsHV86OZiL2HUuroDlK82ZiLGDdWUD Dy7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HGA4j2VSY6/N7k/ZZBSZ6LxcUM89cnL8/TELS3T2UzA=; b=S13H19Xy108cixJm6kI+ychvKhlnIfwhZcsRdv+dsI+pzXUoZK+Vx5REQY30UfQMob mix20G7aSd7vCddwfVDyyJI4XXU5nvI0YJmS81XDPz5bcJmaSz6AN7G/ilr/yt9lGomO rY3Yq57bXvTxjKhLzF8s7xpRbNl0bWeLXj3gjtKrfzUhtBbqiV2I/qoHAtGU5gFBc8vS PjHcUveYZTzc8xHebgBtPn4v/2iAPOce5cXP3Cy7iYTXzxlhCSA6TnvqXm/gws+FBJMp kzBozu1jbgkntPRu30FhGwB0WKGNALLx0nKmNbrRgfHL2KYgbn8+CHAPul6VMXHWh6xO CiiQ== X-Gm-Message-State: AD7BkJLi1D/QmaQolKsM2vc8uyBCEhi+XYJcfpJRDP72D8DroOq1dyCqMz/fQ0Zfa9zoFg== X-Received: by 10.28.178.208 with SMTP id b199mr295294wmf.51.1458938082168; Fri, 25 Mar 2016 13:34:42 -0700 (PDT) Received: from [172.20.0.40] ([165.255.114.188]) by smtp.googlemail.com with ESMTPSA id o128sm347791wmb.19.2016.03.25.13.34.40 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 13:34:41 -0700 (PDT) Subject: Re: [gentoo-user] logrotate: name of log file after it's rotated? To: gentoo-user@lists.gentoo.org References: <87wpoqlr02.fsf@heimdali.yagibdah.de> From: Alan McKinnon X-Enigmail-Draft-Status: N1110 Message-ID: <56F5A0DD.1060004@gmail.com> Date: Fri, 25 Mar 2016 22:34:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <87wpoqlr02.fsf@heimdali.yagibdah.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 0a3755ba-f78a-4e8c-9bca-49afa07fbf02 X-Archives-Hash: 488aa3aa0cb14381aecd875d08db96f2 On 25/03/2016 13:46, lee wrote: > > Hi, > > is there a built-in way (like a place holder) to figure out what name a > rotated log file has been given by logrotate? > > Here's what I'm trying to do: > > > ,---- [ cat /etc/logrotate.d/exim } > | /var/log/exim/exim*.log { > | daily > | missingok > | rotate 800 > | compress > | delaycompress > | notifempty > | create 640 mail mail > | postrotate > | /usr/sbin/eximstats | mail -s "eximstats" root > | endscript > | } > `---- > > > I want replaced with the name the log file that > has been rotated has been renamed to. I can think of ways to do this > otherwise, like writing a script that figures out the name of the file, > or using 'prerotate' instead. > > It just won't make any sense if logrotate doesn't already have some kind > of place holder for this. > It depends. There are options to tell logrotate to use, or not use, dates in the new filename, and what compression to use or not use. So the names can vary. By far the easiest solution is to put your "| mail" into prerotate section. That way you know exactly what the name is. Or maybe not due to that * in the name glob... Perhaps look into renamecopy described in man logrotate -- Alan McKinnon alan.mckinnon@gmail.com