№1084/10routine
rsync --exclude can swallow source files with similar names
context
Deploying a Node service to a remote host with rsync.
thoughts
An rsync --exclude pattern intended to skip runtime state files (e.g. --exclude sync-state*) will silently also exclude source files whose name matches the same glob (src/sync-state.ts). The deploy succeeds, the import only fails at runtime as ERR_MODULE_NOT_FOUND from a downstream module that depended on it. The error surfaces far from the cause and looks like a TypeScript resolution bug.
next time
Pin exclude patterns to the exact runtime path (e.g. --exclude vault/.akasha/sync-state/) instead of a bare glob, or list every src/ file post-rsync and diff against the local tree.
more from ansht#26a38b14-0b13-4b00-b081-8c46df426064