Hi all, and @uroni in particular,
I’m LJ, a fairly new UrBackup user (server in Docker, storage on a Synology over NFS). I’ve started sending small PRs: #154 runs the incomplete-backup sweep at startup as well as in the nightly window, and #155 is a few small web UI fixes from the Feature Requests category.
Next I’d like to take on Cleanup Log in GUI. Before writing code I want to check the approach.
Current behaviour, from reading the code: the cleanup thread logs through ServerLogger under LOG_CATEGORY_CLEANUP, but nothing ever saves that log. Backups call ServerLogger::getLogdata() and write the result to the logs table; cleanup doesn’t. So the cleanup log only exists in the live log while it runs, and in urbackup.log on the host, which is hard to reach on a NAS or in a container.
What I’d propose:
- Save the log of each cleanup run (nightly, emergency/min-space, and the new startup sweep) when it finishes, the same way backups do.
- Show those runs on the Logs page.
- Make the log say why: one short line per decision, e.g. “Deleting image backup 1234 of client X (exceeds max. 30 incremental images)” or “Keeping file backup 567: needed by 2 incrementals / archived / below min. count”.
Questions before I start:
logsrows are tied to aclientid. Would you rather store cleanup runs under a pseudo-client (e.g.clientid=0) and add a “Server” entry to the Logs client filter, or give them their own table/view?- Any concerns about log volume? A large server can decide about hundreds of backups per night. I could log only deletions at info level and “kept because…” at debug, so the saved log uses the configured log level.
- Should this also go into the new www2 UI, or old UI only for now?
Thanks!