Skip to content

Commit

Permalink
Add --no-motd to and remove -l from rsync options. (#962)
Browse files Browse the repository at this point in the history
This PR adds the --no-motd option to the default extra rsync options and
removes -l from the base rsync options.

This means we now have -rtO --delete as the base options and -z,
--contimeout=10, --max-size, and --no-motd as the default extra options that
can be overwritten.
  • Loading branch information
partim authored Jun 10, 2024
1 parent 46fb390 commit c32a65f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 10 additions & 8 deletions doc/manual/source/manual-page.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1083,14 +1083,16 @@ All values can be overridden via the command line options.
default is simply *rsync*.

rsync-args
A list of strings containing the arguments to be passed to the
rsync command. Each string is an argument of its own.

If this option is not provided, Routinator will try to find out
if your rsync understands the ``--contimeout`` option and, if so,
will set it to 10 thus letting connection attempts time out after
ten seconds. If your rsync is too old to support this option, no
arguments are used.
A list of strings containing additional arguments to be passed
to the rsync command. Each string is an argument of its own.

The options ``-rtO --delete`` are always passed to the command.
The options listed in the option are added to it.

If the option is not provided, Routinator will add ``-z`` and
``--no-motd``, as well as ``--contimeout=10`` if it is supported
by the rsync command, and ``--max-size`` if the
``max-object-size`` option has not been set to 0.

rsync-timeout
An integer value specifying the number seconds an rsync command
Expand Down
4 changes: 3 additions & 1 deletion src/collector/rsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ impl RsyncCommand {
Some(ref args) => args.clone(),
None => {
let mut args = Vec::new();
args.push("--no-motd".into());
args.push("-z".into());
let has_contimeout =
output.stdout.windows(12)
.any(|window| window == b"--contimeout");
Expand Down Expand Up @@ -618,7 +620,7 @@ impl RsyncCommand {
for item in &self.args {
cmd.arg(item);
}
cmd.arg("-rltz")
cmd.arg("-rtO")
.arg("--delete")
.arg(source.to_string())
.arg(destination);
Expand Down

0 comments on commit c32a65f

Please sign in to comment.