Summary#
A local platform is created per project, on demand, and each one carries a full database of its own — a few hundred megabytes. Over a few weeks of ordinary work that is tens of gigabytes of projects you have long since moved on from. This deletes the ones that are no longer in use, and tells you first.
Signature#
osy instances --prune [--yes] [--idle-hours <n>] [--json]Description#
It is a dry run unless you pass --yes. On its own it prints what it would delete, what that would reclaim, and —
just as usefully — everything it is KEEPING, with the reason for each. Read it, then re-run with --yes.
An instance is deleted when both are true:
- nothing is running on it. A platform whose server is still up is never touched, and neither is one whose state cannot be established — if it cannot be shown that nothing is running, it stays.
- it has not been used recently. A day, by default;
--idle-hourschanges the window.
Note what is not a condition: whether the project still exists. A checkout can live for months while you start platforms in it several times a day, so keeping every instance of every live project would keep almost all of them. A local platform is disposable by design — rebuilt from your source whenever a command needs one — so deleting one costs a rebuild and nothing else. Nothing you would miss is stored there; your app's real data lives on the platform you deploy to.
Everyday use needs none of this: starting a local platform reaps unused ones as it goes. The command is for when you want to see the number, or clear space now.
Listing your local platforms reports the total on disk every time you run it, so the figure is visible long before it is a problem.
Examples#
osy instances --prune # what would go, and what stays — deletes nothingosy instances --prune --yes # actually delete themosy instances --prune --idle-hours 4 --yes # clearing space nowSee also#
Listing your local platforms — what is on this machine, which are running, and how much disk it all takes.
Stopping the local platform — stop one that is running, so it becomes a candidate.
The inner loop — where local platforms come from in the first place.