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:
35
openspec/specs/recording-cleanup/spec.md
Normal file
35
openspec/specs/recording-cleanup/spec.md
Normal file
@@ -0,0 +1,35 @@
|
||||
### Requirement: Cleanup script removes small recordings
|
||||
The system SHALL provide a shell script that deletes MP3 files below a configurable size threshold from the recordings directory. The default threshold SHALL be 3 KB (3072 bytes).
|
||||
|
||||
#### Scenario: File below threshold is deleted
|
||||
- **WHEN** a `.mp3` file in `/home/m/recordings/` is smaller than the configured size threshold and older than 1 minute
|
||||
- **THEN** the file is deleted
|
||||
|
||||
#### Scenario: File above threshold is preserved
|
||||
- **WHEN** a `.mp3` file in `/home/m/recordings/` is equal to or larger than the configured size threshold
|
||||
- **THEN** the file is not deleted
|
||||
|
||||
#### Scenario: File currently being written is preserved
|
||||
- **WHEN** a `.mp3` file in `/home/m/recordings/` was modified less than 1 minute ago
|
||||
- **THEN** the file is not deleted, regardless of size
|
||||
|
||||
### Requirement: Cleanup runs on a schedule
|
||||
The system SHALL execute the cleanup script via a cron job on the Pi host, running every 5 minutes.
|
||||
|
||||
#### Scenario: Periodic execution
|
||||
- **WHEN** 5 minutes have elapsed since the last run
|
||||
- **THEN** the cleanup script executes and removes qualifying files
|
||||
|
||||
### Requirement: Size threshold is configurable
|
||||
The cleanup script SHALL accept the size threshold as a parameter, allowing adjustment without editing the script.
|
||||
|
||||
#### Scenario: Custom threshold
|
||||
- **WHEN** the script is invoked with a size argument (e.g., `5k`)
|
||||
- **THEN** only files below that size are deleted instead of the default 3 KB
|
||||
|
||||
### Requirement: Cleanup script is version-controlled
|
||||
The cleanup script SHALL be stored in the project repository so that changes are tracked and deployable.
|
||||
|
||||
#### Scenario: Script lives in repo
|
||||
- **WHEN** a developer checks the repository
|
||||
- **THEN** the cleanup script is present at a well-known path with documentation of its purpose
|
||||
Reference in New Issue
Block a user