leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
334 stars 25 forks source link

[Bug] AUTO_DB_BACKUP_KEEP not working properly #310

Closed johnny-tknoska closed 1 month ago

johnny-tknoska commented 1 month ago

Is there an existing issue for this?

Current Behavior

First of all, happy 2-year anniversary of this great project! Congratulations!

There's a bug with the AUTO_DB_BACKUP_KEEP setting. It doesn't work well for DB file backups; it works well for .conf file backups. I have this setting in pialert.conf: AUTO_DB_BACKUP = True AUTO_DB_BACKUP_CRON = '3 19 /2 *' AUTO_DB_BACKUP_KEEP = 9

The backups work fine for both DB backup & .conf backup as you can see from the attached screenshots, but the AUTO_DB_BACKUP_KEEP is not working properly as it only keeps 5 copies of DB files instead of 9....for pialert.conf it works fine keeping 9 copies as expected.

Environment

OS: Raspberry Pi OS 12 bookworm , Native Linux 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64

Anything else?

Pi.Alert .conf backups (9 files OK as expected):

pialert conf backups

Pi.Alert DB backups (just 5 files, not 9 as expected):

pialert db backups
leiweibau commented 1 month ago

Yes, the 5 is still hard-coded in the DB backups. Will be fixed with the next update. Thanks for the report

leiweibau commented 1 month ago

Update released with https://github.com/leiweibau/Pi.Alert/commit/530948a7e9b2b0d78d3168e44ec55f68d0417b0c