Skip to content

FSWatch

fswatch inbound watches files on the local filesystem for changes using operating system notifications.

File notifications require operating system support. On network filesystems such as NFS and SMB, on FUSE mounts, and on virtual filesystems like /proc and /sys, changes that originate on the remote side never generate notifications. Use Polling instead, or a native inbound such as S3 for remote storage.

Structure

{
  "type": "fswatch",
  "tag": "watch-in",
  "path": "/data",
  "debounce": "100ms",
  "follow_symlinks": false,
  "xattr": false,
  "fake_super": false,
  "checksum": false
}

Fields

path

Required

The path to the directory or file to watch.

debounce

Debounce interval for write events.

100ms is used by default.

Follow symbolic links and emit the target content instead of the link.

When disabled, symbolic links are emitted as symbolic links.

Disabled by default.

xattr

Read extended attributes and carry them on each entry, so a Local outbound can restore them. On Linux this also carries POSIX ACLs, which are stored as system.posix_acl_* attributes.

Only supported on Linux and macOS.

Reading attributes costs extra syscalls per file, so it is disabled by default.

fake_super

Reconstruct entries from the sidecar files written by a Local outbound with fake_super. Use this to watch a tree that was restored to a filesystem which could not hold that metadata natively. Changes to sidecar files themselves do not emit entries.

Disabled by default.

checksum

Compute a SHA-256 checksum of each file while reading and carry it on the entry, for compare rules with checksum enabled.

Hashing costs extra CPU per file, so it is disabled by default.

Change Events

See Change Events for the event types emitted and how deletions are handled.