Skip to content

cli: add 'file write' command to upload files over SFTP#189

Open
calvinleng-science wants to merge 1 commit into
mainfrom
calvin/file-write
Open

cli: add 'file write' command to upload files over SFTP#189
calvinleng-science wants to merge 1 commit into
mainfrom
calvin/file-write

Conversation

@calvinleng-science

Copy link
Copy Markdown
Contributor

Summary

Adds a file write subcommand to synapsectl, completing the SFTP file command set alongside the existing ls, get, and rm. It uploads a local file to a device path — the mirror of file get.

Implementation reuses everything get already relies on: the same setup_connection password/auth flow, the same rich progress bar, and paramiko’s SFTPClient.put() (the symmetric partner of the .get() used by file get). If the remote path is an existing directory, the file is uploaded into it; a missing local file and transfer errors are reported cleanly.

Usage:

synapsectl -u <device> file write <remote_path> <local_path>

Note: writing under the SFTP chroot requires the destination directory to be group-writable by the sftp user — see the companion scifi-system change (headstage#498) that provisions models/sdcard/hdf5-replay for this.

Mirror of 'file get': uses paramiko SFTPClient.put() with the same connection
setup, password flow, and progress bar. If the remote path is an existing
directory the file is uploaded into it; missing local files and transfer errors
are reported.

Usage: synapsectl -u <device> file write <remote_path> <local_path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant