I have a strange issue with a cron-scheduled task using find which does two things:
- The first line should delete every night files older than 3 days starting with "read_" and end with ".gz".
- The second line should delete every minute files ending with ".gz.md5" older than 1 minute.
1 1 * * * find <path that defiantly does not match> -type f -iname "read_*.gz" -ctime +3 -delete
*/1 * * * * find <path that defiantly does not match> -type f -iname "*.gz.md5" -cmin +1 -delete
Typically this is working well, but every now and then at 01:01 I get the following error message by cron:
Cron <root@hostname> find <path that defiantly does not match> -type f -iname "read_*.gz" -mtime +3 -delete
find: ‘<path that defiantly does not match>/<hostname>/captured-syslog-1617836127-1617836351.gz.md5’: No such file or directory
But from my point of view, this makes no sense.