Bug#1053517: find commands became noisy in urlcheck/cleanup.logs cron job

Laura Arjona Reina <[email protected]>
Newsgroups gmane.linux.debian.devel.www
Message-ID <9e3dfd8e-fc08-4944-a0bb-df9948f26754__10667.6576937147$1696515154$gmane$org@debian.org>
Package: www.debian.org
Severity: normal
User: [email protected]
Usertags: scripts

Hello all
Since some time (maybe since the www-master machine (wolkenstein) was upgraded 
to bullseye?) we're receiving (at [email protected]) daily mails with noisy 
useless output of the "urlcheck" lessoften job:

-----
-------- Mensaje reenviado --------
Asunto: Cron <debwww@wolkenstein> cd /srv/www.debian.org/cron/urlcheck && 
./cleanup.logs
Fecha: Thu, 05 Oct 2023 13:05:01 +0000
De: Cron Daemon <[email protected]>
Para: [email protected]

rm: cannot remove 'logs': Is a directory
gzip: logs is a directory -- ignored
-----

The code producing the output is here:
https://salsa.debian.org/webmaster-team/cron/-/blob/master/urlcheck/cleanup.logs

Which is just 3 lines, so I copy them here:

---
#!/bin/sh

find logs -daystart -mtime +7 -exec rm {} \;
find logs -daystart -mtime +2 -not -name '*.gz' -exec gzip -9 {} \;
---

the "logs" folder is where other cron jobs store files so I guess we should keep 
it, I'd like just the script to be more silent so we only get mails if there is 
an actual error.

My bash skills are limited, if anybody can help, MR or patches or ideas are welcome.

Kind regards,

Laura Arjona Reina
https://wiki.debian.org/LauraArjona
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.