We had a client's server run out of disk space last night. It looks like fail2ban had made several copies of its database for some reason until it ran out:
-rw------- 1 root root 1232522240 May 4 09:18 fail2ban.sqlite3
-rw------- 1 root root 1232522240 May 3 21:03 fail2ban.sqlite3.20210504-010217
-rw------- 1 root root 1232522240 May 3 21:04 fail2ban.sqlite3.20210504-010359
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010420
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010525
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010548
-rw------- 1 root root 1232522240 May 3 21:06 fail2ban.sqlite3.20210504-010603
-rw------- 1 root root 1105612800 May 3 21:06 fail2ban.sqlite3.20210504-010625
-rw------- 1 root root 0 May 4 09:03 fail2ban.sqlite3.20210504-130353
We deleted it all, but in reviewing this, does Plesk not clear out the fail2ban database? Is there a way to tell it to "within Plesk?" It can be manually pruned and doing so for 90 days on a few servers removes 75-90% of the file size:
sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "delete from bans where timeofban <= strftime('%s', date('now', '-90 days'));"
sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "vacuum;"
Whenever I've looked on any server fail2ban only had around 10-20 IPs listed as banned.
I've also found at least one more with a database copy dating back to March 2020 (fail2ban.sqlite3.2020*).
-rw------- 1 root root 1232522240 May 4 09:18 fail2ban.sqlite3
-rw------- 1 root root 1232522240 May 3 21:03 fail2ban.sqlite3.20210504-010217
-rw------- 1 root root 1232522240 May 3 21:04 fail2ban.sqlite3.20210504-010359
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010420
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010525
-rw------- 1 root root 1232522240 May 3 21:05 fail2ban.sqlite3.20210504-010548
-rw------- 1 root root 1232522240 May 3 21:06 fail2ban.sqlite3.20210504-010603
-rw------- 1 root root 1105612800 May 3 21:06 fail2ban.sqlite3.20210504-010625
-rw------- 1 root root 0 May 4 09:03 fail2ban.sqlite3.20210504-130353
We deleted it all, but in reviewing this, does Plesk not clear out the fail2ban database? Is there a way to tell it to "within Plesk?" It can be manually pruned and doing so for 90 days on a few servers removes 75-90% of the file size:
sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "delete from bans where timeofban <= strftime('%s', date('now', '-90 days'));"
sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "vacuum;"
Whenever I've looked on any server fail2ban only had around 10-20 IPs listed as banned.
I've also found at least one more with a database copy dating back to March 2020 (fail2ban.sqlite3.2020*).
Last edited: