Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1teg6I-00Ezlm-0b for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 19:57:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1teg6G-008C6N-US for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 19:57:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1teg6G-008C6A-JR for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 19:57:48 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1teg6D-002pZC-19 for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 19:57:47 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 27C2AD1CF; Sun, 2 Feb 2025 20:57:13 +0100 (CET) Date: Sun, 2 Feb 2025 20:57:13 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Log retention query Message-ID: <20250202195713.do65y2ewc6vjk3r5@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <20250202082618.trv7vpxw3stkqqw4@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7hpgdecxuc5e6dtw" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7hpgdecxuc5e6dtw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2025-02-02 12:12:07 +0000, Paul Brindusa wrote: > I had the exact same query as Junwang proposed. Assuming that by "query" you mean the crontab entry: Well, if if was *exactly* the same it's unlikely to work since you probably don't have a directory literally called "/path/to/logs". If you made the obvious substitution, it should work provided it runs with appropriate privileges. What is the output if you remove the =AB-exec rm {} \;=BB bit? What happens if you reduce the mtime? > Was mega upset that I could not get the cronjobs to work, and from what I > can tell from @Laurenz's=A0 response above we have the names of the logs > customised to posgtres-%d-%m-%y. Earlier you wrote that the pattern was actually =ABpostgresql-%Y-%m-%d.log=BB. =ABfind ... -name "*.log"=BB would find that= but of course not =ABposgtres-%d-%m-%y=BB. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --7hpgdecxuc5e6dtw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmefzhMACgkQ8g5IURL+ KF36Gw/9EWuuCDH7eeT/424WpV5gEuH1dU/34wM1hvQcP+saS+DEiiA0jVdg7BFO rEMY0ef2t4lbjQLLl6RXPB0h9XNns0tYrjqp3OoOi+3TTkwrtMO3ngFcUz1/B0N4 D7wRU3F6qIXSCJwm5P8osCyOIJFa1I6Yg3Z7qmh5GNDdoErlkF8l9vcOPhVxr6TO 27aI6VjvmZs6VntcfplBYntDDxXb0sB4hgcJhSbQJAxRmK32tb+fi0ZukKtUd6eF 7aNYS5JpHPlqKhcetqdxnZr8lxsZPrXgZC4FWFiVmzDgV+90LTxsWh76qe1w3tjQ 1kdOUXsJJhH6iuhJSBHsXEcm62li1F3md3Pk6YP6hCEM9NEjCuK3oK93OoNWOWj5 BIO3kb105UhWfp9HlrCcVsJUfZ1u8ddOG69wwmNJDlfHzXEBPOYCqrcqvj5RkuGY buLWmRmoEQ/yrkDlRROLnb5igyLRdmXzXqE3WS+4vqHrlUcRR+R75OWiG5ha6h+M ycjZ0ZK7TI7XdBA+YVgPsEm7f80kJ4BXe6V02lXQDjtlttYz0CQRC+8xZjziSXX0 o3S/pSJZukGgphklY5H7gN9Y8fgAltRb8UKh5CGCj9UUfOb5L4PYZGbNTsmKGdc9 GhnLEq6S2IutLt468ZTI8Qlc9l6F0sN3CMHaJfbratcvaGtaEuQ= =WAaA -----END PGP SIGNATURE----- --7hpgdecxuc5e6dtw--