Hi, fail2ban (since 0.11) automatically cleans up stale entries in its database, by default daily. However, the sqlite database is not vacuum'ed so the file size on disk is not reduced after this. On one of my systems, the database file was > 1 GB in size while after vacuum only a 1 M remained, so it really was growing way to large. The attached patch installs a weekly cronjob to perform the vacuum. I've also submitted it as a merge request on salsa. Kind regards, Thijs Kinkhorst
Hi,
Calling VACUUM dwiwith on a running fail2ban may lead to errors:
2025-10-21 15:36:28,210 fail2ban.filterpyinotify[496743]: ERROR Error in FilterPyinotify callback: database is locked
2025-10-21 15:36:33,216 fail2ban.filterpyinotify[496743]: ERROR Error in FilterPyinotify callback: database is locked
2025-10-21 15:36:38,222 fail2ban.filterpyinotify[496743]: ERROR Error in FilterPyinotify callback: database is locked
2025-10-21 15:36:43,227 fail2ban.filterpyinotify[496743]: ERROR Error in FilterPyinotify callback: database is locked
2025-10-21 15:36:48,232 fail2ban.filterpyinotify[496743]: ERROR Error in FilterPyinotify callback: database is locked
So the approach of VACUUM'ing with cron.weekly would need stopping the daemon.
Alex
Would calling VACUUM in a systemd ExecStopPost work ?||