Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6FzC-0005t0-Gy for pgsql-general@arkaria.postgresql.org; Sat, 29 Sep 2018 14:12:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g6FzA-0007sc-II for pgsql-general@arkaria.postgresql.org; Sat, 29 Sep 2018 14:12:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6Fz8-0007sR-Ui for pgsql-general@lists.postgresql.org; Sat, 29 Sep 2018 14:12:44 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6Fz2-0006jq-1w for pgsql-general@lists.postgresql.org; Sat, 29 Sep 2018 14:12:41 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0CCAA213FC; Sat, 29 Sep 2018 10:12:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 29 Sep 2018 10:12:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=E5czd1GPyvuqNTZqT3m7nlQ1YUyhT 5JWrU6uZsq0DCA=; b=NzdpJjPUS2hFUQaznh5BZbsjRZILyTO++KC+m45UuDq6O xXLzTn0bgn12NcGh9jaE+iBzY59PgPz1o5umjTQQT4SSuHMngnSrzSMIMo6NoJ19 MtyxfFjqpMM0nLxv9kcNdDIXBeXsnCjK+Gn1h7pnfg+7vZueE04QDpPUQtO2V4rj hQzQrtDQsvMQnjXV+V2jGAdzEbbyFqp801MnDotSxYSVqENAnxtspIEyNX8b2F7q L4q7jIXsfYLDzAskWS6NMnlMXOd0veJQoZlImbdiUM7U2+G10Oze3KWPyNEdh5sa XQ4WWjVUgY6JtFECeqyk28Zir2bL+PMUxQ76cAySA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=E5czd1 GPyvuqNTZqT3m7nlQ1YUyhT5JWrU6uZsq0DCA=; b=tszW/ESGElPgG/+hWraVZJ qNui8ZUjrp4j1JhJNC1Ev7+LwsD87hdsG6vNhe2UkDDtctgncDKwRHM+/gcwS2YZ lmOD+907ijfCsX9MxGSyjFgzuHNPhXlqpcJ9/d1c5AePof3HvpN+tGF3PbOyzkGw 2wxg+VlT6p8BXmlxVwU/X3L/62YE2q7PPCE9COwX0zOvpvfXGSvq7qdAVoDFltbw YJ3rt8P6Zxy3lGiKPZ4FBeS6Zo36JQBBh+zBCkXP8d8/WvpauNubeUcfpiT8rfk6 pI5bRCOZIpV37Eazd8ENFHhbjVd1H2PJda6imX4rPmclOrNmy9B/umE6SRTfO6PA == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E1BAE47C0; Sat, 29 Sep 2018 10:12:32 -0400 (EDT) Subject: Re: How to maintain the csv log files in pg_log directory only for past 30 days To: Raghavendra Rao J S V , Michael Paquier Cc: pgsql-general@lists.postgresql.org References: <20180928052539.GJ1500@paquier.xyz> <93d6c6ec-141e-70a4-7b15-7c4b1ba4f146@aklaver.com> <20180928225439.GA1823@paquier.xyz> From: Adrian Klaver Message-ID: <568940a5-9a25-d119-b69a-3905cdd61b0b@aklaver.com> Date: Sat, 29 Sep 2018 07:12:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 9/28/18 7:05 PM, Raghavendra Rao J S V wrote: > Hi All, > > Hope you all are recommending below settings to maintain only max 30 > days logs in *pg_log* directory. Please correct me if I am wrong. Well it would actually be 31 days as: http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html %d Replaced by the day of the month as a decimal number [01,31]. [ tm_mday] Not sure if that matters or not. > > log_filename = 'postgresql-%d.log' > log_truncate_on_rotation = 'on', > > Regards, > Raghavendra Rao > > On Sat, 29 Sep 2018 at 04:24, Michael Paquier > wrote: > > On Fri, Sep 28, 2018 at 06:19:16AM -0700, Adrian Klaver wrote: > > If log_truncate_on_rotation = 'on', correct? > > Yup, thanks for precising. > -- > Michael > > > > -- > Regards, > Raghavendra Rao J S V > Mobile- 8861161425 -- Adrian Klaver adrian.klaver@aklaver.com