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 1tegCX-00F0E3-2N for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 20:04:17 +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 1tegCW-008FXW-2f for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2025 20:04:16 +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 1tegCV-008FXN-OI for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 20:04:15 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tegCT-002pc5-1R for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2025 20:04:14 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38632b8ae71so3181592f8f.0 for ; Sun, 02 Feb 2025 12:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738526651; x=1739131451; 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=aOsUJ8+taoweJhG2/4qpzQ0xFz0ra9g+K4LtDbzqrjU=; b=iPlWoD4R+0sm7tSka1lcrR0G6I7nyuAw/rDsnfDV93jAxgUu7UBfZUsW9odpgnJBUY 30kAVTVNyl5copSAEeOZVWDdfbuoCl2xnYmqqay+DztCM3txuYqjXm/vYePeUkFosBqT s66Ll8VdE/D6eHPV7UoN72apK8/2j6pecmKt10ejAM6NcFQZfms3WaEx5OS5dj+/wpqL O0zJj4qqV4vAViDtUQdss0wDJ5wBLMovnehBiK1Z2hZyuIgDuqZHwKMHCdhvNcx//WLS LGx0o/a6havJXJQsIqZQHAfZ0tg8o74e9YrYq1Lk/ot8VitEufHPxlmyFta4jrFi4Yw5 f1bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738526651; x=1739131451; 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=aOsUJ8+taoweJhG2/4qpzQ0xFz0ra9g+K4LtDbzqrjU=; b=GNknvAPq9zf59lcbsu1cTKzBKMj30brDAM4d0tMVzqNevZxIoqQlJITbywQAO8xK5h VtX6skpG4lh9el4+i8THxLjIMJMrOKEdO1s05habVMS+OdV2zMhp7za0LYph1I3CeJ+V jZ8Tdwdf4ax6LRZBJ7yFcIHfatOV+dT3GgDL6TnSqrvVwjwq2dCxlPWyMrNi9u0k6nCF NPU4rUE2LDlI5OSfymOATmzP7Zzsuod6F98aDYzoVo/sHyEFCuFcJkIrfc//PbjrQJ24 NksgyHVhpA848TsSm/d/cHUk/SzWbv5bnokkDB/DTiYHcI4g5JZGGoqOQ9nqTpDMHu+N ITfg== X-Gm-Message-State: AOJu0YxtyUFUlrIxw70JAfbWoYru7alWI5REux0gRGkn8czfGXy6Bgj9 GUWpWc/kmLt7iFqUb30vHeSccxYIHksuOB3YTbZl45JWwEPyxaTLDQkDiZlf X-Gm-Gg: ASbGncsP+QyysV7oM7a0nwXhQrd6Ndn5wzSA58npK+7W3EZtItZp5Z0/wApX+mofx8c JAo1ZFbYBdkE3fkhpaz1CYm0zgXxzZmDpxv9C8i3P8vL/s9l++nkD/OIQgxr3spXkVAeak/Ii8M 0XLmsEbfzMWpqjqwBs5ZSNhHNakLq0tvg0X919MiTmEQC1bZcICN6Ep/3edCk+Bdp6L+f6cKrL0 4R5Ss1+4tztpIrfMOa73ZlqSiGlQ+fkai0HFSKXcau/YlVMvB9IggO0f1o9qksssTIHQknH/E/F UzkJP+zvWsPOGi0tB1iBJ/JDzQqZSON+d/0UGCF1YRUd2ucQW1m0GJ+ZVUT8Op0Vgsqbysir2+0 EEX5D6J4z4CIOnTCYhtSoMfIG X-Google-Smtp-Source: AGHT+IG1wL5JyDBi0FRcMpiEz+2frJpblhIJJQlSOReALjAZ5XcniIRtXZom3ft3tsbGaaZz9xzS6Q== X-Received: by 2002:a05:6000:2a6:b0:386:3262:28c6 with SMTP id ffacd0b85a97d-38c5194cf0cmr15196186f8f.5.1738526650969; Sun, 02 Feb 2025 12:04:10 -0800 (PST) Received: from [192.168.1.2] (wake-09-b2-v4wan-168484-cust1088.vm3.cable.virginm.net. [82.45.212.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438e23de772sm129372615e9.13.2025.02.02.12.04.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Feb 2025 12:04:10 -0800 (PST) Message-ID: <147245a5-5105-4cf1-85cf-bb92176b9702@gmail.com> Date: Sun, 2 Feb 2025 20:04:09 +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> <20250202195713.do65y2ewc6vjk3r5@hjp.at> Content-Language: en-GB From: Paul Brindusa In-Reply-To: <20250202195713.do65y2ewc6vjk3r5@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 I am defo sure that my syntax was fine. I have tried the same syntax to remove the logs manually from the folder  and it worked perfectly. The cronjob was set from root, so I am assuming it has the right privileges over the folder in cause. @ Adrian the cluster runs on Rocky9 There is no error from cron that is the weird bit as well. I do not have MAILTO set up on cron. Regards, Paul On 02/02/2025 19:57, Peter J. Holzer wrote: > 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 «-exec rm {} \;» 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  response above we have the names of the logs >> customised to posgtres-%d-%m-%y. > Earlier you wrote that the pattern was actually > «postgresql-%Y-%m-%d.log». «find ... -name "*.log"» would find that but > of course not «posgtres-%d-%m-%y». > > hp >