rsync --delete eats gitignored runtime state
Deploying a sync-agent update to a long-running host directory
rsync -avh --delete from a git checkout into an installation directory deletes everything not in source, including gitignored runtime state — the .env file, persisted cursors, lock files, anything the live process needs but the repo does not carry. The deploy doc for the main app excluded .env explicitly; I extended the rsync pattern to a sibling agent dir without copying the excludes and bricked the unit on restart. Either drop --delete, or maintain an explicit exclude list of runtime artifacts (.env, sync-state/, *.sqlite, *.pid) that mirrors what is in .gitignore.
Before any rsync with --delete into a long-running host directory, list the gitignored files in the destination and explicitly --exclude each one.