wrolpi/controller
lrnselfreliance a5ab01198b
The backup drive keeps deleted files for 30 days, then removes them (#999)
* The backup drive keeps deleted files for 30 days, then removes them

The fifth part of replacing the sync.  A backup drive never deleted anything, so it grew forever and kept every file
the media directory had ever held.  Now, like a secondary:

- A file deleted from the media directory, or the old version of one that changed, is moved to a dated folder in
  .backup-trash on the backup drive.  Folders older than backup_delete_after_days (sync.yaml; 30 by default, also
  for drives set up before this; none never deletes) are removed, before and after each backup, and the oldest go
  sooner when the drive is nearly full.
- A backup refuses a media directory that is not mounted, or has no config/wrolpi.yaml: copied with deletes, an
  empty folder would move the whole backup drive to the trash.
- The Backup Drive panel has the same "Delete after N days / Never delete them" control as the Sync panel, now one
  component, and refuses an empty number of days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* A nearly full drive keeps the trash it just filled, and makes room for the database

Review found, in the backup drive's trash and in the secondary's sync, which share its shape:

- Below 1 GiB free, the purge after a copy removed the newest trash folder too.  Moving a file to the trash is a
  rename, which frees nothing, so on a nearly full drive a deleted file was gone at the end of the same run instead
  of 30 days later.  The newest folder is now only removed by age (0 days still deletes at once).
- The purge made room only down to 1 GiB, so a database larger than the free space failed to be copied every time
  while the trash was full.  Before the database is written (the backup's snapshot, the secondary's copy of its
  primary's), the trash now makes room for the whole database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:50:21 -07:00
..
api The Controller can make a secondary a copy of its primary with rsync (#992) 2026-11-18 20:21:55 -07:00
lib The backup drive keeps deleted files for 30 days, then removes them (#999) 2026-11-19 16:50:21 -07:00
templates A secondary syncs by rsync: the Controller runs it on its schedule, and both pages follow it (#995) 2026-11-19 15:06:25 -07:00
test The backup drive keeps deleted files for 30 days, then removes them (#999) 2026-11-19 16:50:21 -07:00
__init__.py Creating Controller service which will control WROLPi services, admin, SMART, disks, and status. nginx will fallback to Controller UI when React UI is unavailable (such as during upgrades). 2025-12-15 15:48:40 -07:00
conftest.py The hotspot starts on boot (#829) 2026-10-13 19:29:15 -06:00
defaults.py A WROLPi serves its library over rsync, and makes a database snapshot on request (#988) 2026-11-18 16:47:02 -07:00
main.py A secondary syncs by rsync: the Controller runs it on its schedule, and both pages follow it (#995) 2026-11-19 15:06:25 -07:00
requirements.lock Python packages install from hash-locked requirements; yt-dlp still floats (#913) 2026-11-01 12:00:39 -07:00
requirements.txt build(deps): update pytest-asyncio requirement in /controller (#926) 2026-11-02 12:05:36 -07:00
rsyncd.conf A WROLPi serves its library over rsync, and makes a database snapshot on request (#988) 2026-11-18 16:47:02 -07:00
serve.py Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens. 2026-04-09 15:01:05 -06:00