Question: I have a service that automatically creates a log file with a timestamp in the filename on startup. Thus, I don't need logrotate to rename/copy/create files, but what I do want is that logrotate shall keep just the three newest of those files (and optionally compress them). Can I do that somehow?

Answer: 
I'm not sure you can do this by using `logrotate`. Can you run the following as a daily cron job:

```
rm $(ls -t | sed -e '1,3d')

```
I was attempting to find a similar logrotate solution for ProxySQL's log files, which look like:

```
/var/lib/proxysql/queries.log.00000377
/var/lib/proxysql/queries.log.00000378
/var/lib/proxysql/queries.log.00000379
/var/lib/proxysql/queries.log.00000380
/var/lib/proxysql/queries.log.00000381

```

In the end I gave up on logrotate and just went with a simple cron solution:

```
# Delete old query log files 60 days old
0 4 * * * find /var/lib/proxysql -name 'queries.log.*' -mtime +60 -delete

# compress 5 day old query log files
30 4 * * * find /var/lib/proxysql -name 'queries.log.????????' -mtime +5 -exec gzip {} \;

```