#1034511 apt-cacher-ng: Cron job does not delete old log.html.xz files

Package:
apt-cacher-ng
Source:
apt-cacher-ng
Description:
caching proxy server for software repositories
Submitter:
richardn
Date:
2023-04-17 13:27:04 UTC
Severity:
normal
#1034511#5
Date:
2023-04-17 13:22:30 UTC
From:
To:
This line in the apt-cacher-ng daily cron job does not actually delete any 'maint_*.log.html.xz' files

        find /var/log/apt-cacher-ng -maxdepth 1 -name 'maint_*.log.html.xz' -or -name 'maint_*.log.html' -type f -user apt-cacher-ng -mtime +10 -delete

The find manpage under NON-BUGS "Operator precedence surprises" explains why this does not work.

Brackets with quotes are needed e.g.

        find /var/log/apt-cacher-ng -maxdepth 1 \( -name 'maint_*.log.html.xz' -or -name 'maint_*.log.html' \) -type f -user apt-cacher-ng -mtime +10 -delete

Alternatively the " -or -name 'maint_*.log.html'" can be completely omitted, leaving

        find /var/log/apt-cacher-ng -maxdepth 1 -name 'maint_*.log.html.xz' -type f -user apt-cacher-ng -mtime +10 -delete

as the next line in the cron job compresses all 'maint_*.log.html' files older than 5 days anyway