# backup

> Write the one file a restore reads into a new directory.

`traj backup` writes the one file a restore reads, `traj.jsonl`, into a new directory. It is the
canonical JSONL export under a name that says what it is for. CSV and Markdown do not restore, so
`backup` has no `--format` flag.

- `--out <string>` — a directory to create; it must not already exist; required

```bash
traj backup --out backup                # Write traj.jsonl, the restorable copy.
traj backup --out backup --json         # Describe the file written and its rows.
```

Restore the copy with [`traj restore`](https://docs.trajectonomics.com/cli/commands/restore/). Before removing the stored
data with [`traj data remove`](https://docs.trajectonomics.com/cli/commands/data/), take a fresh backup: the removal only
proceeds when the backup holds exactly the data as it is now.

See [Commands](https://docs.trajectonomics.com/cli/commands/) for the global options, exit codes and error envelope.

Part of the [Docs index](https://docs.trajectonomics.com/llms.txt).
