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 1teYpn-00EJ9y-1h for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 12:12:19 +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 1teYpl-0075RP-Ax for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 12:12:17 +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 1teYpl-0075RG-0F for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 12:12:17 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1teYpi-002mZ2-2u for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 12:12:16 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43626213fffso28070715e9.1 for ; Sun, 02 Feb 2025 04:12:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738498332; x=1739103132; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=tta0wHrrA1ArjkaOtkr++aLRYh/4NpUXkh7WdzvrkjU=; b=K0IoQeYaW9ByqycylU9wIEso1ZicacrbOKAymdv4s9OQQ9PyyEF2of/IcK+ethyqbg dlZ4rfuwFt9sMYsuEauImg2yrzwb9AEaKAHOg7dhRcsUZJtHCrB6rhvl41bgSCstme2k O+KvLI+S2qqiiTV1ajWIP75V3ke+VIGoM1H0/n1cBaZOJMjQlJ31Fc9RUXq0wvSkbDyi GsLuZBh04ci+eMzt15PjU3hTwA+41+xmdeqrOswsnRLy2uHVCuPcks4ZbPlhbmVx/u1S lxpk5sdzfX0vIrR2w8NnJo3LE8jBYHWvURuUwdcZufanSw0oUI8P+hgXcbFW+JNs4AXX WoUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738498332; x=1739103132; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tta0wHrrA1ArjkaOtkr++aLRYh/4NpUXkh7WdzvrkjU=; b=Qf8V2cw5XT8hUmdWvnTD79Dp3X0U2XagxGytJEZCehi8NMY9d7i7ZbGrqQMk+wfaaV YKc1wLG+5k1644z4dIWTVYGhEJ+UjbZbE5ej5UXzznoWj3+mAhpGStxtb7UqnijKL9Hc fL3d41ytV1GxB2q5GEiJMVhjMioZ+eXWXxYQpvnqSAJiemeFurAqtvs+XBsPpHIDW+6z M8XSo3weAw3QuDComLL9ZOFLPAhuqs8r/SeUc5zaQgSKe4sS4fjX5Hj8ySJRzAkOGUIm 2YsQVpoR9BWm4M1gsqszhx8NcS9rzkRjOlSyM/YyRndlYP/4Ig2qej/Sx8JL1q86m9KL kcWw== X-Gm-Message-State: AOJu0Yyzfj4KFLQ4Z2nGCZeoqEvluvyHN7HKOdj39p89OfS7qRJxNMgh /m+wiAUzaTGJ0xkRnOOFKD6YyLpjgegAawrMNfzrTXenCGn6mV3Z8l777pop X-Gm-Gg: ASbGncsYh7v+W0ML6u4KY3cXf1STmVtPZ1fVsJ2zgNoJPDsUFEF0DRfLT4nwtq1QH4s YH4Cs1mPH1Tg9Bn5ZzjzcEL+PlinlB2DpXXr92HVLurzuF7FxT8GhGkvRjhvOhI+gwRD6anJ0a0 keDhku9im/hd2Dv2UQuV3omZTMBQr2KDehUQ7K7QLLNmKw1Ojc4ZyqBqSQsGA3Xpr92TV2qBGn+ s0AqBb7V+yY/1BA6jHihu3AUK7e8mKZ3zSNaqGurtSr0KfXGviPc3CLObWv6f1hPH1tqKcJO6T4 DOGeGzWdYuDGVnHuHQ+iLM8GfpI7Hu5Dp1k+NlTt62qNnAYBXF3ZuPEraW8HWpsAWP4fweayew1 1ZPSXY//3iHLE08r+nvuV8qH68Tc= X-Google-Smtp-Source: AGHT+IFWima055WJMU9dRJmSjrsvriTTHOvvWJRXPy++i1deu2a6I0IYFXr213mjD9spHWTFafpOnQ== X-Received: by 2002:a05:600c:4ec7:b0:438:a313:cda9 with SMTP id 5b1f17b1804b1-438e6eff297mr76362015e9.10.1738498332004; Sun, 02 Feb 2025 04:12:12 -0800 (PST) Received: from [192.168.10.25] (wake-09-b2-v4wan-168484-cust1088.vm3.cable.virginm.net. [82.45.212.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc81a39sm151815465e9.35.2025.02.02.04.12.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Feb 2025 04:12:11 -0800 (PST) Message-ID: Date: Sun, 2 Feb 2025 12:12:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Log retention query To: pgsql-general@lists.postgresql.org References: <20250202082618.trv7vpxw3stkqqw4@hjp.at> Content-Language: en-GB From: Paul Brindusa In-Reply-To: <20250202082618.trv7vpxw3stkqqw4@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Good afternoon Peter, I had the exact same query as Junwang proposed. Was mega upset that I could not get the cronjobs to work, and from what I can tell from @Laurenz's  response above we have the names of the logs customised to posgtres-%d-%m-%y. Removing the logs after a week or month does not since our retention policy is 6 months. The cron job was set from root and it did not remove the logs/ On 02/02/2025 08:26, Peter J. Holzer wrote: > On 2025-01-28 13:40:42 +0000, Paul Brindusa wrote: >> @Junwang apologies, I should have mentioned that  we've tried setting up a >> crontab and it has not worked. > Then you have a cron problem and not a postgresql problem. > > What that problem is is impossible to say with the information you have > given us. What was the exact crontab entry, and what did it do? (When > describing a problem, always use positives, not negatives. "it did not > work" is particularly useless, since there are a gazillion ways in which > something could not do what you expected.) > >> Have you got something similar working? > Yes. Cleaning up stuff is probably one of the most frequent uses of > cron. > > hp >