Skip to content

Nexo File

The file-movement family: local file operations on the sink host. See the overview for how every module executes and the shared parameter types.

The current line is 1.4.0 — the destination is a folder and the file lands there under its own source name. The frozen 1.0.0 line — copy/move/list — stays available for flows built on it, as do 1.1.0, 1.2.0 and 1.3.0.

What it does — copies, moves, or appends files on the sink host.

How it works

  • The first parameter is the operation — copy, move, or append — and it must be a STATIC parameter: a DATA-driven operation is rejected loudly.
  • The destination is a folder — the file lands there under its own source name (/opt/filewatch/testfile2.txt into /opt/filedest becomes /opt/filedest/testfile2.txt). The folder is created when missing.
  • Processing lock — while the source file is being processed, a <source>.lock file exists in the source folder. A concurrent consumer sees it and fails loudly instead of racing the transfer; the lock is removed when processing ends, success or failure. (The folder watch trigger ignores these artifacts — they never fire the flow.)
  • copy — transfers the source into the destination folder (metadata preserved); the original stays.
  • move — copy-then-remove: the source is copied first, and only when the copy succeeded is the original removed. A failed move never loses the source.
  • append — the bytes appended to the source since the previous run are written onto the end of the destination folder’s copy of the file (created when missing). A <source>.track file in the source folder records the last transferred byte position: the first run transfers the whole file, later runs only the appended tail, and a source that shrank (log rotation) transfers from the start again. The track advances only after a successful transfer; the result data reports the bytes transferred.
  • Paths follow the trust model:
    • STATIC paths are flow-author intent — used exactly as written.
    • DATA paths come from the event payload. By default the event’s full path is used as written — folder-watch events carry absolute paths from the platform’s own watcher. When the sink sets NEXO_FILE_ROOT, DATA paths are instead sandboxed against that root: no .. traversal, no absolute paths outside the root, and critical local paths (/etc, /proc, /sys, C:\Windows, …) are refused. Violations fail the event loudly.

Needs from the node — nothing declared; set NEXO_FILE_ROOT on the sink only when you want DATA paths contained to that root. Write access to the source and destination folders is the service’s business: the Linux sink runs sandboxed (ProtectSystem=strict), so every folder its file actions write must be listed via --storage-folders at install (or in the unit’s ReadWritePaths=) — see Install on Linux.

Parameters

KeyType optionsMeaning
operationSTATIC only — copy, move, or appendThe file operation — the first parameter
sourceSTATIC or DATAThe source file
destinationSTATIC or DATAThe target folder — the file lands there under its source name (created when missing)