> ## Documentation Index
> Fetch the complete documentation index at: https://snapr.seshuk.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Local files

> Back up files and directories on the host filesystem with the local source, including exclude pattern syntax.

`type: local` backs up files and directories on the host filesystem. It needs no external tools.

## Example

```yaml snapr.yaml theme={null}
sources:
  - type: local
    path: /var/data
    excludes:
      - '*.tmp'
      - '*.log'
      - 'node_modules'
```

## Options

| Option     | Type      | Required | Description                                                                                            |
| ---------- | --------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `type`     | `local`   | Yes      |                                                                                                        |
| `path`     | string    | Yes      | Absolute or relative path to the directory.                                                            |
| `excludes` | string\[] | No       | Glob patterns matched against paths relative to `path`. Matching entries are skipped from the archive. |

## Notes

* When `excludes` is empty, snapr symlinks the source path into the working directory — no copy is made. With `excludes`, snapr walks the tree and copies file by file.
* Exclude patterns are matched against each entry's path relative to `path`. Supported forms:
  * `*.tmp` — glob (Go `filepath.Match` syntax) against the path or just the filename.
  * `temp/` — a trailing slash means "anything under this directory".
  * `**/cache/**` — a named directory at any depth.
  * `node_modules` — a bare literal also matches by directory or filename.

## Related

* [Sources overview](/configuration/sources/overview)
* [SQLite source](/configuration/sources/sqlite) — for consistent dumps of SQLite files
