google/cdc-file-transfer

[cdc_rsync] [cdc_stream] Use sftp for deployment

ljusten opened this issue · 1 comments

sftp allows to batch remote copy commands together with rename, chmod and mkdir commands, see https://man.openbsd.org/sftp. This way, the remote components can be deployed atomically with one sftp command.

For instance, for cdc_rsync we currently

  • Create %appdata%\cdc-file-transfer\bin in the server start command (because scp can't mkdir)
  • Call scp to copy cdc_rsync_server to a temp location
  • Call ssh to chmod and rename the temp location to the actual location
    sftp could do all of that in one command.

We probably have to write a local temp file with commands and call sftp -b (unless there's a way to pass commands via args).

Fixed by PR #64 and #66.