mirror of
https://github.com/upa/mscp.git
synced 2026-02-15 17:54:43 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32f4b450ea | ||
|
|
dbc96f9166 | ||
|
|
fd5c6e971e | ||
|
|
44b21994b5 | ||
|
|
c18fb6996f | ||
|
|
e56336286a | ||
|
|
e56c2d7050 | ||
|
|
38633e31bd | ||
|
|
f6d9a212b9 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -69,7 +69,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
cp -r mscp mscp-${{env.VERSION}}
|
cp -r mscp mscp-${{env.VERSION}}
|
||||||
tar cvf mscp-${{env.VERSION}}.tar.gz --exclude-vcs mscp-${{env.VERSION}}
|
tar zcvf mscp-${{env.VERSION}}.tar.gz --exclude-vcs mscp-${{env.VERSION}}
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -1,4 +1,4 @@
|
|||||||
# mscp
|
# mscp: multi-threaded scp
|
||||||
|
|
||||||
[](https://github.com/upa/mscp/actions/workflows/build-ubuntu.yml) [](https://github.com/upa/mscp/actions/workflows/build-macos.yml) [](https://github.com/upa/mscp/actions/workflows/test.yml)
|
[](https://github.com/upa/mscp/actions/workflows/build-ubuntu.yml) [](https://github.com/upa/mscp/actions/workflows/build-macos.yml) [](https://github.com/upa/mscp/actions/workflows/test.yml)
|
||||||
|
|
||||||
@@ -15,6 +15,8 @@ standard `sshd` supporting the SFTP subsystem (e.g. openssh-server),
|
|||||||
and you need to be able to ssh to the hosts as usual. `mscp` does not
|
and you need to be able to ssh to the hosts as usual. `mscp` does not
|
||||||
require anything else.
|
require anything else.
|
||||||
|
|
||||||
|
https://user-images.githubusercontent.com/184632/206889149-7cc6178a-6f0f-41e6-855c-d25e15a9abc5.mp4
|
||||||
|
|
||||||
|
|
||||||
Differences from `scp` on usage:
|
Differences from `scp` on usage:
|
||||||
|
|
||||||
@@ -60,11 +62,11 @@ patch -d libssh -p1 < patch/libssh-0.10.4.patch
|
|||||||
bash ./scripts/install-build-deps.sh
|
bash ./scripts/install-build-deps.sh
|
||||||
|
|
||||||
# configure mscp
|
# configure mscp
|
||||||
mkdir build && mv build
|
mkdir build && cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
|
|
||||||
## in macOS, you may need OPENSSL_ROOT_DIR for cmake:
|
# in macOS, you may need OPENSSL_ROOT_DIR for cmake:
|
||||||
cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl@1.1
|
# cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl@1.1
|
||||||
|
|
||||||
# build
|
# build
|
||||||
make
|
make
|
||||||
@@ -72,6 +74,9 @@ make
|
|||||||
# install the mscp binary to CMAKE_INSTALL_PREFIX/bin (usually /usr/local/bin)
|
# install the mscp binary to CMAKE_INSTALL_PREFIX/bin (usually /usr/local/bin)
|
||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
Source tar balls (`mscp-X.X.X.tar.gz`, not `Source code`) in
|
||||||
|
[Releases page](https://github.com/upa/mscp/releases) contains the patched version
|
||||||
|
of libssh. So you can start from cmake with it.
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
@@ -136,7 +141,7 @@ copy done: test/testdir/asdf
|
|||||||
|
|
||||||
```console
|
```console
|
||||||
$ mscp -h
|
$ mscp -h
|
||||||
mscp v0.0.5: copy files over multiple ssh connections
|
mscp v0.0.6: copy files over multiple ssh connections
|
||||||
|
|
||||||
Usage: mscp [vqDCHdNh] [-n nr_conns] [-m coremask]
|
Usage: mscp [vqDCHdNh] [-n nr_conns] [-m coremask]
|
||||||
[-s min_chunk_sz] [-S max_chunk_sz] [-a nr_ahead] [-b buf_sz]
|
[-s min_chunk_sz] [-S max_chunk_sz] [-a nr_ahead] [-b buf_sz]
|
||||||
@@ -154,6 +159,7 @@ Usage: mscp [vqDCHdNh] [-n nr_conns] [-m coremask]
|
|||||||
-v increment verbose output level
|
-v increment verbose output level
|
||||||
-q disable output
|
-q disable output
|
||||||
-D dry run
|
-D dry run
|
||||||
|
-r no effect
|
||||||
|
|
||||||
-l LOGIN_NAME login name
|
-l LOGIN_NAME login name
|
||||||
-p PORT port number
|
-p PORT port number
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ void usage(bool print_help) {
|
|||||||
" -v increment verbose output level\n"
|
" -v increment verbose output level\n"
|
||||||
" -q disable output\n"
|
" -q disable output\n"
|
||||||
" -D dry run\n"
|
" -D dry run\n"
|
||||||
|
" -r no effect\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -l LOGIN_NAME login name\n"
|
" -l LOGIN_NAME login name\n"
|
||||||
" -p PORT port number\n"
|
" -p PORT port number\n"
|
||||||
@@ -248,7 +249,7 @@ int main(int argc, char **argv)
|
|||||||
m.buf_sz = DEFAULT_BUF_SZ;
|
m.buf_sz = DEFAULT_BUF_SZ;
|
||||||
m.nr_threads = default_nr_threads();
|
m.nr_threads = default_nr_threads();
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "n:m:s:S:a:b:vqDl:p:i:c:M:CHdNh")) != -1) {
|
while ((ch = getopt(argc, argv, "n:m:s:S:a:b:vqDrl:p:i:c:M:CHdNh")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'n':
|
case 'n':
|
||||||
m.nr_threads = atoi(optarg);
|
m.nr_threads = atoi(optarg);
|
||||||
@@ -313,6 +314,9 @@ int main(int argc, char **argv)
|
|||||||
case 'D':
|
case 'D':
|
||||||
dryrun = true;
|
dryrun = true;
|
||||||
break;
|
break;
|
||||||
|
case 'r':
|
||||||
|
/* for compatibility with scp */
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
opts.login_name = optarg;
|
opts.login_name = optarg;
|
||||||
break;
|
break;
|
||||||
@@ -681,6 +685,7 @@ void mscp_stat_handler(int signum)
|
|||||||
} else {
|
} else {
|
||||||
/* called from mscp_stat_final. calculate progress from the beginning */
|
/* called from mscp_stat_final. calculate progress from the beginning */
|
||||||
print_progress(&s.start, &s.after, s.total, 0, s.done);
|
print_progress(&s.start, &s.after, s.total, 0, s.done);
|
||||||
|
pprint(1, "\n"); /* this is final output. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ static int ssh_set_opts(ssh_session ssh, struct ssh_opts *opts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opts->hmac) {
|
if (opts->hmac) {
|
||||||
pr_warn("%s\n", opts->hmac);
|
|
||||||
if (ssh_options_set(ssh, SSH_OPTIONS_HMAC_C_S, opts->hmac) < 0) {
|
if (ssh_options_set(ssh, SSH_OPTIONS_HMAC_C_S, opts->hmac) < 0) {
|
||||||
pr_err("failed to set hmac for client to server\n");
|
pr_err("failed to set hmac for client to server\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user