jscp¶
A tool named jscp is provided with Jetstream. It may be used to quickly transfer a file or folder between two locations which are running Jetstream servers. The tool operates similar to scp.
jscp is part of the Jetstream Python package, and will be available on command line if the Python package is installed. Alternatively, it can be found in the Python module jetstream.tools.jscp
, and can be executed directly (jetstream/tools/jscp.py
). Please refer to the Installation section for path to the Python package on your platform.
Synopsis¶
jscp [options] source destination
Description¶
The jscp tool is intended to be used for sending and receiving files between two jetstream servers.
Options¶
-
-p
<source_api_port>
,
--serverPort
<source_api_port>
¶ Specifies the API port of the Jetstream server that will send the copied files. This flag is optional. If not specified, a default of 8886 will be used.
-
-P
<destination_receive_port>
,
--destinationPort
<destination_receive_port>
¶ Specifies the destination port. This is the receiver port of the Jetstream server that will receive the copied files. This flag is optional. If not specified, a default of 8886 will be used.
-
-o
<destination_api_port>
,
--destinationAPIPort
<destination_api_port>
¶ Specifies the API port of the Jetstream server that will receive the copied files. This flag is optional. If not specified, a default of 8886 will be used.
-
-r
<maximum_send_rate>
,
--sendRateMax
<maximum_send_rate>
¶ Specifies the maximum send rate that should be used during the file copy. Jetstream will automatically adjust the rate at which it sends data, but during this file copy will not allow it to exceed this rate. This flag is optional. If not specified, the maximum send rate is not restricted (but is still subject to server configuration limits and network conditions).
The maximum send rate is specified in kilobits per second.
-
-s
<source_send_port>
,
--senderPort
<source_send_port>
¶ Specifies the source port. This is the sender port of the Jetstream server that will send the copied files. This flag is optional. If not specified, a random port will be allocated.
-
-d
<destination_path>
,
--destinationPath
<destination_path>
¶ Specifies the path to use when writing these files at their destination. This path may be the same as the source, or you may choose a different path.
Note
Files at the destination will be written as described in Where Do Transfers Go?
For example, you can choose to write the destination at the same location as the source:
jscp /path/to/file.txt jetstream1:/path/to/file.txt
Or, you may “flatten” the directory structure from the source, and not use any on the destination.
jscp /path/to/file.txt jetstream1:file.txt
Or, you may choose to use the same name as the source, but specify a different parent folder.
jscp /path/to/file.txt jetstream1:/branch/documentation/file.txt
Or, you may choose something entirely different:
jscp /path/to/file.txt jetstream1:/something/completely/different.readme
-
--no-encryption
¶
Disables encryption, and attempts to create an unencrypted connection.
This option would only be required if the receiving server was launched with encryption disabled.
-
-q
,
--quiet
¶
Suppresses all console output. This may be useful when the command is run from a script, or in cases where the environment does not have TTY capabilities.
-
-b
,
--batch
¶
Suppresses the use of the curses library when drawing the progress bar. Instead, progress will be reported line-by-line, separated by newlines. This may be useful when the command is run from a script.
-
-v
¶
Be more verbose when starting transfers
-
-h
,
--help
¶
Displays a usage summary, along with examples for how to specify the source and destination paths.
Source and Destination¶
The host from which the source file is copied is specified as part of the source path.
- Example:
jscp hostname:/path/to/source ...
The source host may be specified as a name or an IP:
- Example:
jscp repo:/path/to/source ... jscp 10.10.1.2:/path/to/source ...
If you are copying a file from your local workstation, you can omit the host. In this case, “localhost” will be assumed:
- Example:
jscp /path/to/source ...
The above is the same as:
- Example:
jscp localhost:/path/to/source ...
The host to which the file is copied is specified as part of the destination path. For example:
- Example:
jscp ... hostname:/path/to/destination
The destination host may be specified as a name or an IP:
- Example:
jscp ... jetstream1:/path/to/destination jscp ... 10.10.64.8:/path/to/destination
A Jetstream server must be running on both the source and destination hosts.
Examples¶
With a Jetstream server running locally (on “localhost”) and on a remote host named “jetstream1”, copy the file from “/home/user/readme.txt” to the same path at the destination. The Jetstream servers are not running in encrypted mode. The default send rate will be used.
$ jscp /home/user/readme.txt jetstream1:/home/user/readme.txt
complete: 100% complete (0.00 kbps)
This small file is transmitted quickly enough that it immediately reports as “complete.”
Copy the directory “/project/manhattan/code” to a directory named “manhattan” at the destination. The Jetstream servers are not running in encrypted mode. A specified send rate will keep the bandwidth friendly.
$ jscp -r 10000 /project/manhattan/code jetstream1:manhattan
pending: 0% complete (0.00 kbps)
sending: 0% complete (3791.37 kbps)
sending: 15% complete (7617.82 kbps)
sending: 31% complete (9504.10 kbps)
sending: 46% complete (9504.10 kbps)
sending: 61% complete (9537.33 kbps)
sending: 77% complete (9497.39 kbps)
complete: 100% complete (0.00 kbps)