SafeDisk AI

Audio Temp Files Fill /tmp After Upload

Podcast, video, and media-generation workers often write composed output to a temp file, upload it, then forget to remove the temp file. The safe fix is not a broad rm -rf /tmp; first prove which generated files are stale, then delete only temp outputs whose upload already succeeded.

Ask free AI judgment

Find what you can delete.

Leave your email now. The scan summary can follow after the first reply; we send the free SafeDisk AI deletion trial step only if deletion risk is still unclear.

Add command output optional

Free trial step. We reply first with a delete / confirm / protect judgment or one read-only detail we still need.

See sample result Ask AI about one file

Measure The Temp File Backlog

Start with read-only checks. They list temp-dir capacity and the largest composed audio files without opening file contents.

Read-only check

Find generated audio files that are filling temp storage.

Use this before deleting anything. It works on Linux/macOS workers and stays scoped to likely composed audio outputs.

tmp="${TMPDIR:-/tmp}"
echo "tmp=$tmp"
df -h "$tmp" 2>/dev/null || true
df -i "$tmp" 2>/dev/null || true

find "$tmp" -maxdepth 1 -type f \( -name 'composed_*.mp3' -o -name 'composed_*.wav' -o -name 'composed_*.m4a' \) -print0 2>/dev/null \
  | xargs -0 du -h 2>/dev/null \
  | sort -hr \
  | head -40

Safe Cleanup Boundary

  1. Keep failed-upload temp files so retries still have source bytes.
  2. Delete only after the upload returns success and the object key is recorded.
  3. Restrict cleanup to the system temp directory after resolving the real path.
  4. Require regular files with expected generated names such as composed_*.mp3.
  5. Never delete user uploads, project assets, data/, or working directories from this cleanup path.
  6. Log path, byte size, episode ID, and cleanup result, but not audio contents.
Emergency reclaim

Move only old generated temp files to a quarantine folder.

Use this only after confirming these files are stale or already uploaded. It moves files instead of permanently deleting them.

tmp="${TMPDIR:-/tmp}"
quarantine="$tmp/safedisk-audio-temp-quarantine-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$quarantine"

find "$tmp" -maxdepth 1 -type f \( -name 'composed_*.mp3' -o -name 'composed_*.wav' -o -name 'composed_*.m4a' \) -mmin +120 -print0 2>/dev/null \
  | while IFS= read -r -d '' file; do
      mv "$file" "$quarantine/"
    done

du -sh "$quarantine" 2>/dev/null || true

Implementation Guardrails

Need a deletion judgment for a live worker?

Copy the read-only check first. Request the free SafeDisk AI deletion trial only if the output, app state, or cleanup boundary is still not obvious.

Free AI deletion trial

Need a delete / confirm / protect answer?

Send the issue link, log excerpt, or storage summary first. We reply with the next safe move and offer the free SafeDisk AI deletion trial only if the incident still needs review.

Add output optional

Start with email. Output can follow after the first reply.