mirror of
https://github.com/upa/mscp.git
synced 2026-02-10 06:44:44 +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: |
|
||||
cd ..
|
||||
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
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
require anything else.
|
||||
|
||||
https://user-images.githubusercontent.com/184632/206889149-7cc6178a-6f0f-41e6-855c-d25e15a9abc5.mp4
|
||||
|
||||
|
||||
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
|
||||
|
||||
# configure mscp
|
||||
mkdir build && mv build
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
|
||||
## in macOS, you may need OPENSSL_ROOT_DIR for cmake:
|
||||
cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl@1.1
|
||||
# in macOS, you may need OPENSSL_ROOT_DIR for cmake:
|
||||
# cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl@1.1
|
||||
|
||||
# build
|
||||
make
|
||||
@@ -72,6 +74,9 @@ make
|
||||
# install the mscp binary to CMAKE_INSTALL_PREFIX/bin (usually /usr/local/bin)
|
||||
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
|
||||
|
||||
@@ -136,7 +141,7 @@ copy done: test/testdir/asdf
|
||||
|
||||
```console
|
||||
$ 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]
|
||||
[-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
|
||||
-q disable output
|
||||
-D dry run
|
||||
-r no effect
|
||||
|
||||
-l LOGIN_NAME login name
|
||||
-p PORT port number
|
||||
|
||||
@@ -102,6 +102,7 @@ void usage(bool print_help) {
|
||||
" -v increment verbose output level\n"
|
||||
" -q disable output\n"
|
||||
" -D dry run\n"
|
||||
" -r no effect\n"
|
||||
"\n"
|
||||
" -l LOGIN_NAME login name\n"
|
||||
" -p PORT port number\n"
|
||||
@@ -248,7 +249,7 @@ int main(int argc, char **argv)
|
||||
m.buf_sz = DEFAULT_BUF_SZ;
|
||||
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) {
|
||||
case 'n':
|
||||
m.nr_threads = atoi(optarg);
|
||||
@@ -313,6 +314,9 @@ int main(int argc, char **argv)
|
||||
case 'D':
|
||||
dryrun = true;
|
||||
break;
|
||||
case 'r':
|
||||
/* for compatibility with scp */
|
||||
break;
|
||||
case 'l':
|
||||
opts.login_name = optarg;
|
||||
break;
|
||||
@@ -681,6 +685,7 @@ void mscp_stat_handler(int signum)
|
||||
} else {
|
||||
/* called from mscp_stat_final. calculate progress from the beginning */
|
||||
print_progress(&s.start, &s.after, s.total, 0, s.done);
|
||||
pprint(1, "\n"); /* this is final output. */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user