Skip to content

Commit b9f0bd8

Browse files
committed
Run retention pruning even when no new recordings are found
The early exit on zero DB results was bypassing the retention step. Retention should run on every cycle regardless of new footage.
1 parent 8285227 commit b9f0bd8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/backup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ EOSQL
218218
# Count results (subtract header line)
219219
TOTAL=$(echo "$CSV" | tail -n +2 | grep -c . || true)
220220
if [ "$TOTAL" -eq 0 ]; then
221-
log "No new recordings found. Done."
221+
log "No new recordings found."
222+
if [ -n "${RETENTION_DAYS}" ] || [ -n "${RETENTION_PERCENT}" ]; then
223+
run_retention_prune
224+
fi
225+
log "Done."
222226
exit 0
223227
fi
224228
log "Found ${TOTAL} recording file(s) to back up"

0 commit comments

Comments
 (0)