Trash & Recovery
Deleting a file in Vela is reversible. vela rm moves it into the trash with all its metadata, where it waits for VELA_TRASH_RETENTION — 14 days by default — before the janitor removes it for good.
How it works
- A trash entry is a snapshot of the object — path, metadata, visibility and a reference to its content. The content itself is not copied.
- Each entry has its own trash ID and remembers the original path. The same path can be in the trash several times; entries are ordered by deletion.
- Restoring brings back the same object ID, so signed links to the file work again (as long as they have not expired), and so do symlinks pointing at it — even when it is restored under another path.
- Trashed objects are invisible publicly and absent from listings; they still count towards disk usage.
- Overwriting a file with
put --forcedoes not put the old version in the trash — Vela has no versioning. Moving or restoring with--forcedoes trash the replaced file.
Listing the trash
$ vela trash ls
ID DELETED PURGED AT SIZE PATH
01m4tsckh38p9w9qrhawdsjxge 2026-10-13 19:06 2026-10-27 19:06 15 B docs/welcome.txt
01m4tsd9c1b7k2m0x5w8e3qf4n 2026-10-12 10:41 2026-10-26 10:41 2.4 MiB drafts/q3.pdf
$ vela trash ls drafts/
Entries are listed newest first, with the time each will be purged automatically; trashed symlinks show their target. An optional directory narrows the list by original path, and --by-tag by the tags the file had when it was deleted. Listing requires an rw key; entries outside a key's prefix are invisible to it.
Restoring
vela trash restore ID|ORIGINAL_PATH [--to PATH] [--force]
$ vela trash restore docs/welcome.txt
Restored docs/welcome.txt
$ vela trash restore 01m4tsd9c1b7k2m0x5w8e3qf4n --to drafts/q3-recovered.pdf
Restored drafts/q3-recovered.pdf
- By original path, the most recently deleted entry for that path is restored.
- By ID, exactly that entry is restored — use this when the same path was deleted several times.
--torestores under a different path.- If something already occupies the target path, the restore fails with exit code 4.
--forcemoves the occupying file to the trash first. - File/directory conflicts at the target fail with
path_conflict. - If the object had an
expires_atthat has already passed, restoring clears it — otherwise the janitor would trash it again right away.
A prefix-restricted key can only restore into its own prefix.
vela trash restore --by-tag q1 docs/ restores the newest matching entry of every original path below docs/. It checks first that all of those paths are free and asks before restoring; --to is not allowed with a selection. See Tag Selection.
Purging
vela trash purge [ID...] [--older-than DURATION] [-y]
vela trash purge 01m4tsd9c1b7k2m0x5w8e3qf4n # one entry
vela trash purge --older-than 7d -y # entries deleted more than a week ago
vela trash purge -y # empty the whole trash
Purging is permanent, requires an admin key and asks for confirmation unless you pass -y (which is required without a terminal). Purging an entry also deletes its signed-link records, and purging a file leaves its symlinks broken for good (gone); the CLI warns how many. vela trash purge --by-tag scratch purges the entries of tagged files after showing them. To skip the trash entirely when deleting, use vela rm --purge.
Purged files can only be recovered from a backup.
Automatic retention
On every pass, the janitor permanently deletes trash entries older than VELA_TRASH_RETENTION. Set a longer retention for more safety, or a shorter one to reclaim disk space faster:
VELA_TRASH_RETENTION=30d
The janitor also moves expired objects into the trash, so self-destructing files get the same grace period. Content of purged entries is physically removed by the garbage collector after a 15-minute grace period.
Trash over HTTP
| Operation | Request | Scope |
|---|---|---|
| List | GET /api/v1/trash?prefix=&path=&tag=&limit=&cursor= | rw |
| Restore | POST /api/v1/trash/{id}/restore with {"path": "", "overwrite": false} | rw |
| Purge one | DELETE /api/v1/trash/{id} | admin |
| Purge many | DELETE /api/v1/trash?older_than=7d | admin |
Details in the endpoint reference.