mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
update console output and doc
This commit is contained in:
@@ -20,6 +20,12 @@ mscp \- copy files over multiple SSH connections
|
|||||||
.BI \-I \ INTERVAL\c
|
.BI \-I \ INTERVAL\c
|
||||||
]
|
]
|
||||||
[\c
|
[\c
|
||||||
|
.BI \-W \ CHECKPOINT\c
|
||||||
|
]
|
||||||
|
[\c
|
||||||
|
.BI \-R \ CHECKPOINT\c
|
||||||
|
]
|
||||||
|
[\c
|
||||||
.BI \-s \ MIN_CHUNK_SIZE\c
|
.BI \-s \ MIN_CHUNK_SIZE\c
|
||||||
]
|
]
|
||||||
[\c
|
[\c
|
||||||
@@ -131,6 +137,47 @@ single source IP address for a short period as a brute force attack.
|
|||||||
This option inserts intervals between the attempts to avoid being
|
This option inserts intervals between the attempts to avoid being
|
||||||
determined as an attack. The default value is 0.
|
determined as an attack. The default value is 0.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-W \fICHECKPOINT\fR
|
||||||
|
Specifies a checkpoint file path to save the state of a failed
|
||||||
|
transfer. When transferring fails due to, for example, connection
|
||||||
|
disruption or user interrupt,
|
||||||
|
.B mscp
|
||||||
|
writes the information about remaining files and chunks to the
|
||||||
|
specified checkpoint file.
|
||||||
|
.B \-W
|
||||||
|
option with
|
||||||
|
.B \-D
|
||||||
|
(dry-run mode) only writes a checkpoint file and exits.
|
||||||
|
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-R \fICHECKPOINT\fR
|
||||||
|
Specifies a checkpoint file path to resume a transfer. When this
|
||||||
|
option with a checkpoint file is passed,
|
||||||
|
.B mscp
|
||||||
|
loads a remote host, copy direction, and files and their chunks to be
|
||||||
|
transferred from the checkpoint file. Namely,
|
||||||
|
.B mscp
|
||||||
|
can resume a past failed transfer from the checkpoint. Resumeing with
|
||||||
|
a checkpoint does not require
|
||||||
|
.I source ... target
|
||||||
|
arguments. Other options for establishing SSH connections, for
|
||||||
|
example, username, port number, config file, should be specified as
|
||||||
|
with the failed run. In addition, checkpoint files contain files as
|
||||||
|
relative paths. Thus, you must run
|
||||||
|
.B mscp
|
||||||
|
in the same working directory as the failed run.
|
||||||
|
|
||||||
|
|
||||||
|
You can see contents of a checkpoint file with
|
||||||
|
.B mscp
|
||||||
|
.I \-vvv \-D \-R CHECKOPOINT
|
||||||
|
command.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-s \fIMIN_CHUNK_SIZE\fR
|
.B \-s \fIMIN_CHUNK_SIZE\fR
|
||||||
Specifies the minimum chunk size.
|
Specifies the minimum chunk size.
|
||||||
@@ -306,6 +353,24 @@ Copy a local file and a directory to /tmp at a remote host:
|
|||||||
$ mscp ~/src-file dir1 10.0.0.1:/tmp
|
$ mscp ~/src-file dir1 10.0.0.1:/tmp
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
|
.PP
|
||||||
|
Save a checkpoint if transfer fails:
|
||||||
|
|
||||||
|
.nf
|
||||||
|
$ mscp -W checkpoint srcdir 10.0.0.1:dst/
|
||||||
|
.fi
|
||||||
|
|
||||||
|
.PP
|
||||||
|
Check remaining files and chunkes, and resume a failed transfer:
|
||||||
|
|
||||||
|
.nf
|
||||||
|
# dump a checkpoint and exit (dry-run mode)
|
||||||
|
$ mscp -vvv -D -R checkpoint
|
||||||
|
|
||||||
|
# resume transferring from the checkpoint
|
||||||
|
$ mscp -R checkpoint
|
||||||
|
.fi
|
||||||
|
|
||||||
.PP
|
.PP
|
||||||
In a long fat network, following options might improve performance:
|
In a long fat network, following options might improve performance:
|
||||||
|
|
||||||
@@ -324,7 +389,6 @@ will be faster than the default chacha20-poly1305 cipher, particularly
|
|||||||
on hosts that support AES-NI.
|
on hosts that support AES-NI.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR scp (1),
|
.BR scp (1),
|
||||||
.BR ssh (1),
|
.BR ssh (1),
|
||||||
|
|||||||
42
doc/mscp.rst
42
doc/mscp.rst
@@ -2,7 +2,7 @@
|
|||||||
MSCP
|
MSCP
|
||||||
====
|
====
|
||||||
|
|
||||||
:Date: v0.1.4
|
:Date: v0.1.4-19-g5f628b6
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
====
|
====
|
||||||
@@ -14,6 +14,7 @@ SYNOPSIS
|
|||||||
|
|
||||||
**mscp** [**-46vqDpHdNh**] [ **-n**\ *NR_CONNECTIONS* ] [
|
**mscp** [**-46vqDpHdNh**] [ **-n**\ *NR_CONNECTIONS* ] [
|
||||||
**-m**\ *COREMASK* ] [ **-u**\ *MAX_STARTUPS* ] [ **-I**\ *INTERVAL* ] [
|
**-m**\ *COREMASK* ] [ **-u**\ *MAX_STARTUPS* ] [ **-I**\ *INTERVAL* ] [
|
||||||
|
**-W**\ *CHECKPOINT* ] [ **-R**\ *CHECKPOINT* ] [
|
||||||
**-s**\ *MIN_CHUNK_SIZE* ] [ **-S**\ *MAX_CHUNK_SIZE* ] [
|
**-s**\ *MIN_CHUNK_SIZE* ] [ **-S**\ *MAX_CHUNK_SIZE* ] [
|
||||||
**-a**\ *NR_AHEAD* ] [ **-b**\ *BUF_SIZE* ] [ **-l**\ *LOGIN_NAME* ] [
|
**-a**\ *NR_AHEAD* ] [ **-b**\ *BUF_SIZE* ] [ **-l**\ *LOGIN_NAME* ] [
|
||||||
**-P**\ *PORT* ] [ **-F**\ *CONFIG* ] [ **-i**\ *IDENTITY* ] [
|
**-P**\ *PORT* ] [ **-F**\ *CONFIG* ] [ **-i**\ *IDENTITY* ] [
|
||||||
@@ -69,6 +70,29 @@ OPTIONS
|
|||||||
option inserts intervals between the attempts to avoid being
|
option inserts intervals between the attempts to avoid being
|
||||||
determined as an attack. The default value is 0.
|
determined as an attack. The default value is 0.
|
||||||
|
|
||||||
|
**-W CHECKPOINT**
|
||||||
|
Specifies a checkpoint file path to save the state of a failed
|
||||||
|
transfer. When transferring fails due to, for example, connection
|
||||||
|
disruption or user interrupt, **mscp** writes the information about
|
||||||
|
remaining files and chunks to the specified checkpoint file. **-W**
|
||||||
|
option with **-D** (dry-run mode) only writes a checkpoint file and
|
||||||
|
exits.
|
||||||
|
|
||||||
|
**-R CHECKPOINT**
|
||||||
|
Specifies a checkpoint file path to resume a transfer. When this
|
||||||
|
option with a checkpoint file is passed, **mscp** loads a remote
|
||||||
|
host, copy direction, and files and their chunks to be transferred
|
||||||
|
from the checkpoint file. Namely, **mscp** can resume a past failed
|
||||||
|
transfer from the checkpoint. Resumeing with a checkpoint does not
|
||||||
|
require *source ... target* arguments. Other options for establishing
|
||||||
|
SSH connections, for example, username, port number, config file,
|
||||||
|
should be specified as with the failed run. In addition, checkpoint
|
||||||
|
files contain files as relative paths. Thus, you must run **mscp** in
|
||||||
|
the same working directory as the failed run.
|
||||||
|
|
||||||
|
You can see contents of a checkpoint file with **mscp** *-vvv -D -R
|
||||||
|
CHECKOPOINT* command.
|
||||||
|
|
||||||
**-s MIN_CHUNK_SIZE**
|
**-s MIN_CHUNK_SIZE**
|
||||||
Specifies the minimum chunk size. **mscp** divides a file into chunks
|
Specifies the minimum chunk size. **mscp** divides a file into chunks
|
||||||
and copies the chunks in parallel.
|
and copies the chunks in parallel.
|
||||||
@@ -199,6 +223,22 @@ Copy a local file and a directory to /tmp at a remote host:
|
|||||||
|
|
||||||
$ mscp ~/src-file dir1 10.0.0.1:/tmp
|
$ mscp ~/src-file dir1 10.0.0.1:/tmp
|
||||||
|
|
||||||
|
Save a checkpoint if transfer fails:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
$ mscp -W checkpoint srcdir 10.0.0.1:dst/
|
||||||
|
|
||||||
|
Check remaining files and chunkes, and resume a failed transfer:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# dump a checkpoint and exit (dry-run mode)
|
||||||
|
$ mscp -vvv -D -R checkpoint
|
||||||
|
|
||||||
|
# resume transferring from the checkpoint
|
||||||
|
$ mscp -R checkpoint
|
||||||
|
|
||||||
In a long fat network, following options might improve performance:
|
In a long fat network, following options might improve performance:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|||||||
@@ -133,8 +133,6 @@ int checkpoint_save(const char *pathname, int dir, char *remote, pool *path_pool
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_notice("checkppoint: save to %s", pathname);
|
|
||||||
|
|
||||||
/* write meta */
|
/* write meta */
|
||||||
memset(&meta, 0, sizeof(meta));
|
memset(&meta, 0, sizeof(meta));
|
||||||
meta.hdr.type = OBJ_TYPE_META;
|
meta.hdr.type = OBJ_TYPE_META;
|
||||||
@@ -173,7 +171,7 @@ int checkpoint_save(const char *pathname, int dir, char *remote, pool *path_pool
|
|||||||
nr_chunks++;
|
nr_chunks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("checkpoint: %u paths and %u chunks saved", nr_paths, nr_chunks);
|
pr_notice("checkpoint: %u paths and %u chunks saved", nr_paths, nr_chunks);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -201,7 +199,7 @@ static int checkpoint_load_meta(struct checkpoint_obj_hdr *hdr, char *remote, si
|
|||||||
snprintf(remote, len, "%s", meta->remote);
|
snprintf(remote, len, "%s", meta->remote);
|
||||||
*dir = meta->direction;
|
*dir = meta->direction;
|
||||||
|
|
||||||
pr_notice("checkpoint: loaded, remote=%s direction=%s", meta->remote,
|
pr_notice("checkpoint: remote=%s direction=%s", meta->remote,
|
||||||
meta->direction == MSCP_DIRECTION_L2R ? "local-to-remote" :
|
meta->direction == MSCP_DIRECTION_L2R ? "local-to-remote" :
|
||||||
meta->direction == MSCP_DIRECTION_R2L ? "remote-to-local" :
|
meta->direction == MSCP_DIRECTION_R2L ? "remote-to-local" :
|
||||||
"invalid");
|
"invalid");
|
||||||
@@ -237,7 +235,7 @@ static int checkpoint_load_path(struct checkpoint_obj_hdr *hdr, pool *path_pool)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("checkpoint: %s -> %s", p->path, p->dst_path);
|
pr_info("checkpoint:path: %s -> %s", p->path, p->dst_path);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -263,7 +261,7 @@ static int checkpoint_load_chunk(struct checkpoint_obj_hdr *hdr, pool *path_pool
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_debug("checkpoint: %s 0x%lx-0x%lx", p->path, c->off, c->off + c->len);
|
pr_debug("checkpoint:chunk: %s 0x%lx-0x%lx", p->path, c->off, c->off + c->len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,6 +483,7 @@ out:
|
|||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
if ((dryrun || ret != 0) && checkpoint_save) {
|
if ((dryrun || ret != 0) && checkpoint_save) {
|
||||||
|
print_cli("save checkpoint to %s\n", checkpoint_save);
|
||||||
if (mscp_checkpoint_save(m, checkpoint_save) < 0) {
|
if (mscp_checkpoint_save(m, checkpoint_save) < 0) {
|
||||||
pr_err("mscp_checkpoint_save: %s", priv_get_err());
|
pr_err("mscp_checkpoint_save: %s", priv_get_err());
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user