aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2025-11-13 20:54:59 -0800
committerDan Fandrich <danf@mageia.org>2025-11-13 21:27:44 -0800
commita9a044081a6d0fb4be6edca221fe4f3a53b3bdf7 (patch)
tree1210e55b9141bf52b3f1ecab3cc427a6fd8a2c3b
parent1926a14f6a7d48fa03e67835c472bc66cb89a291 (diff)
downloadmgamirrors-a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7.tar
mgamirrors-a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7.tar.gz
mgamirrors-a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7.tar.bz2
mgamirrors-a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7.tar.xz
mgamirrors-a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7.zip
Suppress error messages from rsync
Despite being given the --quiet option, rsync will write an error message if it can't change to a directory on the remote server. This happens for servers that mirror only a subset of architectures and results in cron mailing error messages on every such run. Since errors are tracked elsewhere, just drop anything going to stderr from rsync.
-rw-r--r--lib/MGA/Mirrors/DB.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm
index 2e54847..51d784f 100644
--- a/lib/MGA/Mirrors/DB.pm
+++ b/lib/MGA/Mirrors/DB.pm
@@ -288,9 +288,10 @@ sub _check_url {
close($fh);
my $cmd =
$furi->scheme =~ /^http|ftp$/ ? "wget -q --no-check-certificate -nv -t 1 -T 4 -O $filename " . $furi->as_string :
- $furi->scheme eq 'rsync' ? "rsync --timeout 4 -q " . $furi->as_string . " $filename" : '';
+ $furi->scheme eq 'rsync' ? "rsync --timeout 4 -q " . $furi->as_string . " $filename 2>/dev/null" : '';
my $ok = (system($cmd) == 0);
unlink($filename);
+ #print STDERR "Result of \"$cmd\" was " . ($ok ? "ok" : "failure") . "\n";
return $ok
}