From a9a044081a6d0fb4be6edca221fe4f3a53b3bdf7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 13 Nov 2025 20:54:59 -0800 Subject: 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. --- lib/MGA/Mirrors/DB.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } -- cgit v1.2.1