Commit Graph

1 Commits

Author SHA1 Message Date
polybjorn
bb9349f4e9 feat(cli): add purge.php to apply purge policy from CLI (#8740)
- Adds `cli/purge.php` so the purge policy can be applied from cron, mirroring `cli/db-optimize.php`.
- Documents it in `cli/README.md`.

Aims to be a small, contained answer to #3636: reuses the same `Feed::cleanOldEntries()` logic the GUI's "Purge now" button calls, packaged as a standard `cli/` script.

Mirror the existing db-optimize.php pattern so administrators can run the
purge policy on a schedule instead of waiting for the 1/30 random trigger
in feedController, or clicking 'Purge now' in the GUI.

The script applies the same archiving policy as the GUI button: per-feed
attribute, per-category attribute, then user config; with the existing
keep_favourites / keep_unreads / keep_labels / keep_min / keep_period /
keep_max guards. With no policy configured, it is a no-op.

Refs: https://github.com/FreshRSS/FreshRSS/issues/3636

Co-authored-by: Bjørn A. Andersen <polybjorn@users.noreply.github.com>
2026-05-01 08:20:42 +02:00