Skip to content

Synchronize directories

connect sync [flags] source destination

Mirrors a source into one or more destinations (comma-separated). Only changed files are transferred, and optional flags control deletions and timestamp handling.

  • source — a single directory or prefix to act as the reference copy.
  • destination — one destination or a comma-separated list (dest1,dest2).
  • -r, --recursive — enable directory traversal (required when syncing folders).
  • --delete — remove files that only exist on the destination.
  • --ignore-existing — skip files that already exist on the receiver.
  • --update — skip files newer on the destination.
  • --size-only — compare by size only (ignore modification time).
  • --no-times — do not preserve modification timestamps.
  • --dry-run — preview planned actions without making changes.
  • -p, --parallel — number of worker threads (default 1).
  • --timeout — network timeout in seconds (default 30).
  • --key, --src-key, --dst-key — SSH key paths when SFTP endpoints are involved.
  • --batch, --progress, --compact, --stats-interval, --no-color, --quiet — logging and progress controls.
  • --sftp-max-conn, --sftp-idle-timeout, --sftp-pool-disable — adjust SFTP pooling to match server limits.
  • Separate multiple destinations with commas: @warehouse/staging/,s3://backup/delta/.
  • An alias can inject credentials per endpoint; combine with inline options for custom behaviour (e.g., MinIO URLs, SAS tokens).
  • When syncing to several destinations, failures are reported individually at the end of the run.
Terminal window
# Mirror a local tree into SFTP
$ connect sync -r /data/export/ sftp://ops:password@10.0.0.24/incoming/
# Sync to two targets, deleting removed files along the way
$ connect sync -r --delete /data/outgoing/ @primary/drop/,s3://backup/drop/
# Dry-run to preview the plan
$ connect sync -r --dry-run /srv/media/ @staging/cdn/
# Skip files that are newer on the destination
$ connect sync -r --update /srv/datasets/ s3://analytics-bucket/datasets/