# Pod Harvest & Watched Folders

> Automatically sync files written inside a running Pod to Asset Hub using semantic paths, live watched folders, include glob rules, and real-time folder status.

Source: https://docs.meshive.ai/assets/harvest/

A Pod can write files and have them become [assets](/assets/) on their own — no upload step, no SDK call. See [Getting data in](/assets/ingest/) for web uploads, task outputs, Hugging Face / CivitAI imports, and bucket registration.

## Semantic paths

The Pod's template declares **semantic paths**: a role plus a directory.

| Role | Meaning |
| --- | --- |
| `output` | Harvested — everything written here becomes an asset |
| `config` | Harvested — configs and recipes alongside the outputs |
| `dataset`, `lora`, `model` | Placement targets — where attached assets are mounted |
| `checkpoint`, `diffusion_model`, `vae`, `text_encoder`, `controlnet`, `embedding`, `upscale_model` | Finer-grained placement targets, one per model kind (used by the ComfyUI templates) |
| `model_cache` | Recommended volume location; never force-mounted, so it can't shadow content baked into the image |

Official templates ship with declarations. For your own templates, add them under **Semantic Paths** in the template form.

Inside the container the declared directories are exposed as environment variables (`MESHIVE_SYS_OUTPUT_DIR`, `MESHIVE_SYS_DATASET_DIR`, …), so scripts don't hardcode paths. Each variable holds one path — the template's default folder for that role — so `MESHIVE_SYS_OUTPUT_DIR` points at the default output folder; files there are saved while that folder is on in **Save from**, and folders you add there are saved without needing a variable. A Pod with no declaration still gets `/outputs`.

The Pod's edit screen lists these variables, read-only, under **Environment variables → set by Meshive**.

> **Note:**
> The older names (`MESHIVE_OUTPUT_DIR`, `MESHIVE_DATASET_DIR`, `MESHIVE_POD_ASSET_TOKEN`, …) are still set with the same values for now, so existing scripts keep working — switch them to the `MESHIVE_SYS_` names. Names starting with `MESHIVE_SYS_`, and the older names while they're still set, can't be used for your own environment variables; any other name, including other `MESHIVE_` names, is yours to use. To add many of your own variables at once, paste `KEY=VALUE` lines into a variable name, or click **Import from file** in the same section ([supported formats](/serverless/tasks/projects/#import-environment-variables)).

## Watched folders

By default, a Pod watches its template's `output` and `config` semantic paths — anything written there is saved to Assets automatically. The sync is **one-way**: deleting a file inside the Pod doesn't delete the asset already made from it (more on this below).

You can change which folders a Pod watches, both when you deploy it and while it keeps running — no restart required:

- **At deploy time**, the Pod create form has a **Watched folders** section: turn a template's folders off or back on, edit their include patterns, or add folders of your own. You can also type a different path for a template's **output** folder — `MESHIVE_SYS_OUTPUT_DIR` and the folder's storage move with it. Config folders stay where the template puts them, because the app expects them there.
- **On a running Pod**, open its **Assets** tab → **Watched folders** to do the same live. A stopped Pod picks up the change the next time it starts. A running Pod's output folder can't move, because the app is already writing to it — use **Save a different folder instead**, which turns the template folder off and adds yours, then point your app at the new folder.

Templates that don't declare an output folder — inference servers such as NIM or vLLM — can save folders too: add your own as long as the Pod has storage to hold them (a volume from **Advanced settings** at deploy time, or from **Pod Edit** later).

A watched folder has to be somewhere the Pod already has storage: an attached local volume, a path a template auto-provisions storage for, or `/workspace` — as long as no network volume is mounted there (see below). A folder outside all of these can't be watched — attach a volume that covers it from **Pod Edit** first, then point the watched folder there.

> **Note — Network volumes aren't watched:**
> Files on a [network volume](/storage/) stay in storage you manage yourself — they aren't uploaded to Assets.
>
> - You can't add a folder that sits on a network volume, or one with a network volume mounted inside it.
> - A template folder that lands on one, and a folder you added before the network volume was attached, show as **off** with the reason. Your own folders can still be removed. If you detach the network volume later, a folder that's still on attached storage comes back as it was.
> - A local volume mounted deeper inside a network volume is still watched as usual.
> - The Pod also checks where each folder really is: a folder that turns out to be on a network volume — through a link, for example — is skipped, and the panel says why. After you move such a folder off network storage, restart the Pod so it's checked again.
>
> Pods that were already watching such a folder stop within about ten minutes (Pods older than watched folders, at their next restart). Assets already uploaded from it stay in Assets.

Folders you add yourself default to capturing **only files created from that point on** — whatever is already sitting in the folder is left alone. Turn on **Also upload files already in this folder** to bring in the existing ones too; since that's a real upload, it's billed the same as any other harvested output.

> **Note:**
> Pods created before watched folders shipped keep their template's default folders as-is until their next restart. After that, they work the same as a new Pod.
>
> Older Pods from templates without an output folder have no uploader, so their **Watched folders** panel offers **Turn on folder saving** instead. It adds the uploader with the Pod's current settings and storage — a running Pod restarts once, after you confirm — and then you can add folders. A Pod with no storage asks you to attach a volume in **Pod Edit** first.

### What gets harvested

- The unit is a **direct child** of a watched folder: a file becomes one asset; a subfolder becomes one asset containing the whole tree (subject to the per-entry file limit below).
- A background agent watches for entries that have stopped changing, then syncs them. Files still being written are not picked up mid-write.
- **Writing to the same path keeps syncing into the same asset — there's no versioning.** New files are added; a file at a path the asset already has is replaced in place by the newer copy, not turned into a new version of it. A file your training script rotates away on the Pod's disk **stays** in the asset — harvest only adds and replaces, unchanged content is skipped, and an idle Pod uploads nothing.
- **Moving a watched folder to a different path re-uploads it as new assets.** Pointing a watched folder at a different path — rather than just narrowing what it matches — starts over: its files upload as new assets, separate from whatever was already harvested from the old path. Narrowing an include pattern doesn't do this; files that fall out of scope are simply left alone, not re-uploaded.
- **A volume moved to a new Pod uploads again.** Harvest keeps track per Pod. If you delete a Pod and attach its local volume to a new one, the new Pod uploads what's already in its template's watched folders as new assets — they aren't deduplicated against the old Pod's. Folders you add yourself only capture files created after you add them, unless you turn on **Also upload files already in this folder**.
- **Include rules** — each watched folder can carry comma-separated glob patterns (e.g. `*.safetensors, images/`). When set, only matching files are collected; when empty, everything is. Templates define them per path under **Semantic Paths**, and each Pod can override them live from its **Watched folders** panel, no restart needed. In a Pod's **Save from** list, the button next to a folder lets you turn on several kinds at once (**Images**, **Videos**, **Model files**, **Data & logs**) and add your own patterns. Empty files and Meshive's own bookkeeping directory are always skipped.
- **Files Meshive put there are skipped** — a [bundled ComfyUI workflow](/assets/using/#bundled-comfyui-workflows) is not your work until you change it, so it stays out of your asset list. Edit it and the edit is harvested normally.
- **Deleting an asset is one-way** — its files are never re-uploaded from that Pod, even if the same content is still sitting on disk. A new file that later shows up in the same folder lands in a **new** asset instead. **Deleting individual files from a live (not-deleted) asset is not the same thing** — the file may still be on the Pod's disk, and harvest doesn't check what you removed from the asset, so the next sync re-adds it. Delete it on the Pod too if you don't want it back. Deleting a file inside the Pod does not, by itself, delete it from the asset — the two only meet through harvest sync.

## Folder status & limits

The **Watched folders** panel on the Pod's **Assets** tab shows what the Pod is actually reporting, per folder — not just what you configured:

- Files seen so far, and how many are still waiting to upload.
- Problems, if there are any — for example the folder is missing, a permission was denied, or the storage behind it stopped responding.
- Whether your latest change has taken effect yet, so "I turned this off" and "it hasn't applied yet" don't look the same on screen.

**Limits.** A harvested entry goes through the same upload path as a web upload, so the same ceilings apply — per harvest sync, not per asset. An asset that keeps syncing accumulates files across many syncs and isn't itself capped at these numbers.

| Limit | Value |
| --- | --- |
| Max size per file | 500 GiB |
| Max files in one entry | 1000 |

An entry over either limit is **reported as an error on that entry** and left where it is — nothing is silently truncated, and the rest of the directory keeps harvesting normally. Split the folder, or pack it into a single archive file, and it goes through.

> **Caution:**
> Pods with a harvest role always get storage for it — a small volume is provisioned with the Pod and grows automatically as outputs pile up. It is billed like any other local volume ([Pricing](/documentation/pricing/)) and it disappears with the Pod, so anything you want to keep must have been harvested.
