Move files with post-copy cleanup
Command overview
Section titled “Command overview”connect move [flags] source_files... destination
move copies files to a new location and deletes the source after each successful transfer. It is ideal for hand-offs where the inbox should be cleared automatically.
Required arguments
Section titled “Required arguments”source_files...— one or more local/remote paths, globs, or regex filters.destination— exactly one endpoint or alias receiving the files.
Frequently used flags
Section titled “Frequently used flags”-r, --recursive— descend into directories referenced by the sources.--flat— with--recursive, discard the original directory structure at the destination.-p, --parallel— number of concurrent workers (default1).--timeout— network timeout in seconds (default30).--key,--src-key,--dst-key— SSH key material for SFTP transfers.--batch,--progress,--compact,--stats-interval,--no-color,--quiet— control the logging style.--failover-dst <uri>+--failover-sticky— retry a fallback target when the primary write fails.--sftp-max-conn,--sftp-idle-timeout,--sftp-pool-disable— adjust the SFTP pool characteristics.
Safety checklist
Section titled “Safety checklist”- Start runs with
--batchand capture logs to verify discovery before wiring into automation. - Keep an alias-based backup destination available through
--failover-dstto avoid data loss. - Consider staging directories or versioned storage if files must survive on both sides.
Examples
Section titled “Examples”# Move staging archives into SFTP$ connect mv /data/outgoing/*.zip sftp://deploy:pass@10.0.0.5/incoming/
# Use aliases and parallel workers$ connect mv -r --parallel 4 /exports/billing/@done/*.csv @warehouse/drop/
# Fall back to S3 when the primary SFTP endpoint fails$ connect mv /exports/logs/*.gz sftp://ops@10.0.0.5/logs/ --failover-dst s3://backups/hourly/
# Move everything that matches a regex$ connect mv /data/reports/regex:^report_.*\.json$ @warehouse/raw/