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

16
cleanup-recordings.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Deletes small MP3 recordings that are likely noise/false positives.
# Runs in a loop, intended for use inside a Docker container.
#
# Environment variables:
# SIZE_THRESHOLD - find -size format, e.g. 3k, 5k, 10k (default: 3k)
# INTERVAL - seconds between runs (default: 300)
RECORDINGS_DIR="/recordings"
SIZE_THRESHOLD="${SIZE_THRESHOLD:-3k}"
INTERVAL="${INTERVAL:-300}"
while true; do
find "$RECORDINGS_DIR" -type f -name '*.mp3' -size "-${SIZE_THRESHOLD}" -mmin +1 -delete
sleep "$INTERVAL"
done