Files
sdr-recorder/openspec/changes/archive/2026-03-21-recording-cleanup-cron/tasks.md
Michael Smith 94fdaf7644 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>
2026-03-21 18:32:17 +00:00

854 B

1. Cleanup Script

  • 1.1 Create cleanup-recordings.sh in the repo with configurable size threshold (default 3k), -mmin +1 safety guard, targeting /recordings
  • 1.2 Make the script executable and add a usage comment at the top

2. Docker Compose

  • 2.1 Update cleanup-recordings.sh to run as a loop with sleep instead of one-shot, read threshold from SIZE_THRESHOLD env var
  • 2.2 Add sdr-cleanup service to docker-compose.yml using alpine image, mounting the recordings volume and running the script

3. Deployment Cleanup

  • 3.1 Remove the host crontab entry installed earlier on sdr-pi
  • 3.2 Remove the script copy from /home/m/cleanup-recordings.sh on sdr-pi

4. Verification

  • 4.1 Deploy updated docker-compose to sdr-pi and confirm the cleanup container starts and deletes small files