Add recording cleanup container to remove noise files

Alpine-based sdr-cleanup container runs a find loop every 5 minutes,
deleting MP3 files under 3 KB (configurable via SIZE_THRESHOLD env var)
to keep the web browser and Samba share free of false-positive recordings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Smith
2026-03-21 18:32:17 +00:00
parent d3effff7db
commit 94fdaf7644
8 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
## 1. Cleanup Script
- [x] 1.1 Create `cleanup-recordings.sh` in the repo with configurable size threshold (default 3k), `-mmin +1` safety guard, targeting `/recordings`
- [x] 1.2 Make the script executable and add a usage comment at the top
## 2. Docker Compose
- [x] 2.1 Update `cleanup-recordings.sh` to run as a loop with sleep instead of one-shot, read threshold from `SIZE_THRESHOLD` env var
- [x] 2.2 Add `sdr-cleanup` service to `docker-compose.yml` using `alpine` image, mounting the recordings volume and running the script
## 3. Deployment Cleanup
- [x] 3.1 Remove the host crontab entry installed earlier on `sdr-pi`
- [x] 3.2 Remove the script copy from `/home/m/cleanup-recordings.sh` on `sdr-pi`
## 4. Verification
- [x] 4.1 Deploy updated docker-compose to `sdr-pi` and confirm the cleanup container starts and deletes small files