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>
854 B
854 B
1. Cleanup Script
- 1.1 Create
cleanup-recordings.shin the repo with configurable size threshold (default 3k),-mmin +1safety 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.shto run as a loop with sleep instead of one-shot, read threshold fromSIZE_THRESHOLDenv var - 2.2 Add
sdr-cleanupservice todocker-compose.ymlusingalpineimage, 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.shonsdr-pi
4. Verification
- 4.1 Deploy updated docker-compose to
sdr-piand confirm the cleanup container starts and deletes small files