Nightly host cleanup
A direct VPS hygiene timer that removes stale top-level /tmp debris, vacuums the systemd journal to a target size, and optionally cleans the apt package cache.
Operating model
timed jobThis timer reclaims transient host disk without touching Symphony-managed state. It leaves workspaces, npm and Playwright caches, Codex stores, Docker or containerd images, and the local Supabase stack to their own lifecycle.
The script is intentionally narrow. It does not touch Symphony workspaces, Codex databases, caches, Docker images, or the local staging stack.
System shape
click the nodesHost cleanup is a root-level service with an explicit dry-run mode and three narrow cleanup phases.
Cadence design
compare modesEach timed job has a small set of modes that decide whether the run is healthy, degraded, or ready to create follow-up work. Use the controls to compare the operating contract.
Remove stale top-level debris
The script only considers top-level entries older than TMP_TTL_DAYS and skips system socket or private directories.
- TMP_ROOT exists
- mtime older than TTL
- system directories skipped
- estimated freed size logged
Run with DRY_RUN=1 and inspect stale paths before allowing deletion.
Execution tracks
interactiveThe tracks make each run inspectable. They separate inputs, outputs, and failure modes so reports do not collapse into vague status updates.
Temporary files
Agent runs leave logs, locks, and throwaway directories in /tmp. The job removes only stale top-level entries.
- TMP_ROOT
- TMP_TTL_DAYS
- mtime
- removed entry count
- estimated freed size
- skipped system dirs
Host hygiene risk map
priority mapThe job runs as root, so the safety boundary matters more than the cleanup amount.
969084767264Output rubric
ticket rulesThe run should create follow-up work only when the output is concrete. Use the rubric to keep reports, bug tickets, and operational follow-ups separated.
Cleaned
Stale /tmp entries, journal size, or apt cache were cleaned and each phase logged.
- /tmp entries removed
- journal vacuumed
- apt cache cleaned
Run contract
evidence rowsThe host cleanup contract is explicit phase logging, dry-run support, and a hard boundary around managed state.
Root housekeeping
symphony-host-cleanup.timer starts host_cleanup.sh with narrow defaults for /tmp, journal, and apt cache cleanup.
No Symphony state
The job does not touch workspaces, Codex databases, npm caches, Playwright caches, Docker images, or local Supabase state.
TMP_ROOT and TMP_TTL_DAYSStale /tmp entry countEstimated /tmp freed sizeJournal disk usage and targetAPT_CLEAN settingDry-run statusSkipped phase reasonsFinal host cleanup statusCommand plan
operator pathDry-run first when changing defaults, then use systemd for normal operation.
sudo DRY_RUN=1 /opt/symphony/elixir/scripts/host_cleanup.shsudo /opt/symphony/elixir/scripts/host_cleanup.shsudo systemctl enable --now symphony-host-cleanup.timerjournalctl -u symphony-host-cleanup.service -n 100 --no-pagerDocker images, Supabase data, workspaces, Codex stores, and caches should each have a dedicated cleanup path instead of being folded into this root job.
Rollout path
ship safelyDry-run current defaults preview
Inspect candidate /tmp entries and journal targets before changing host state.
Run manually once evidence
Confirm each phase logs a clear action or skip reason.
Enable nightly timer systemd
Install the service and timer units, daemon-reload, and enable the timer.
Track disk pressure source ops
When disk remains high, identify the subsystem and add a dedicated cleanup instead of widening this one.