Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-motd to and remove -l from rsync options. #962

Merged
merged 3 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading