Content Retention

Per-folder automatic aged-file deletion, with a 24-hour grace bin so a mistake never costs you data.

Files pile up. Compliance says they can't.

Every regulated file-transfer workflow has a rule that starts the same way: “delete after N days.” Transaction files purge after 90. Log archives after 30. Personal data after seven years. The details differ; the pattern doesn't.

The pattern's implementation, though, is almost always the same brittle shape: a cron job, a shell script, and a scheduled task that nobody remembers to review after the person who wrote it left. When a file gets deleted that shouldn't have, nobody knows. When the script silently stops running, nobody knows that either.

Stylus SFTP Server's Content Retention feature makes the rule a first-class property of the folder itself, backed by a worker that logs every action, audits every file, and never deletes anything without a 24-hour undo window.

Four dimensions, one checkbox

Each Virtual Folder carries its own retention policy. Off by default; nothing changes on existing folders until an operator turns it on.

Virtual Folder attributes

Enable content retentionON
Retention days30  (minimum 3)
Age fromMODIFIED
ScopeRECURSIVE
File-path pattern.*\.log$

Four values plus the master toggle. Together they describe every retention rule you're likely to write:

  • Retention days — files older than N days are eligible. Minimum 3, no ceiling. The floor is there to make a typo like 0 or 1 impossible.
  • Age fromCreated or Modified. Which timestamp counts as "old" depends on what the workflow considers a file's age. Modified survives file copies more predictably; Created matches how most humans read a timestamp.
  • ScopeRecursive walks the whole tree; Root only touches only files directly under the folder root. Useful when the top of the folder is the daily "landing zone" but the sub-folders hold data that lives longer.
  • File-path pattern — an optional Java regular expression against the file's path relative to the folder root. Blank matches every file. Match only .log files, only files under archive/, only invoices in a specific naming scheme — whatever the rule calls for.

Uncheck the master toggle and the other four values are preserved, so a temporary pause doesn't lose the operator's settings. Re-enable and everything comes back exactly where it was.

The 24-hour grace bin

Deletion is a two-step operation. Files eligible for deletion don't disappear — they wait.

Grace Bin

3 pending items across 2 folders — sorted by countdown

Pending in grace bin: 3 items — 1 reap at next tick
FolderPathSizeDelete afterCountdownReason
/uploads_austinXMLPipelineServer.exe.sha512 158 B2026-07-23 09:14 ⚠ reaps at next tick age > 3 days by MODIFIED
/releases/acmearchive/2025/foo.pdf 12 MB2026-07-23 14:47 4h 12m age > 30 days by CREATED
/logs/prod2026-07-19-prod.log 4.3 MB2026-07-24 03:00 17h 25m age > 7 days by MODIFIED

When a file becomes eligible, the retention worker moves it into a hidden .retention/ staging area (mirroring the original physical path, drive letter URL-encoded, timestamp on the leaf). The file stays there for 24 hours. Then and only then does the reaper delete it from disk.

During the grace window, any admin can:

  • Restore the file back to its original location — atomic rename, zero data loss.
  • Delete Now to force the reap early, if you're sure the file should go.

Every action — the staging, the reaping, the restore, the force-delete — goes through the same audit trail as everything else in the server. A typo in the policy can't nuke a customer's data overnight. If you set days = 3 when you meant 30, you have a full day to notice and undo it.

Watch it work

A dedicated Content Retention page shows the worker's health at a glance and the global grace bin sorted by urgency.

📂

Live worker status

Stage path, sweep interval, grace window, last run, next run — always current, no digging through logs.

50-tick history

Every tick recorded with counts staged, reaped, and warnings. Distinguishes scheduled from on-demand runs.

▶️

Run Now

Fire an immediate tick without disturbing the scheduled cadence. Useful for testing a new policy or clearing a backlog.

📋

Global grace bin

Every staged file across every VD, sorted by urgency, with a countdown column colored red / amber / grey.

🔑

Four audit events

Policy change, staged, restored, deleted — all tagged with the actor and searchable in the audit log.

🛠️

Three admin surfaces

Everything — the policy, the runs history, the grace bin, Run Now — is available from Web, Swing, and CLI.

Available on every edition

Content Retention ships with every edition of Stylus SFTP Server — Free, Standard, Professional, and Enterprise. It is a compliance feature, not a paid tier. Whichever installer you download, the retention worker is included, the admin page is available, and the audit trail covers every action.

Setting a policy takes effect on the next tick with no restart. Turning retention off is a checkbox click. Every design choice defaults to the safe side.

Get retention off your ops team's plate

Free evaluation key, full feature set, no time limit on the install — the retention worker is on from day one.

Request Evaluation Key Read the Docs