Commit 8c438494 authored by Dietmar Maurer's avatar Dietmar Maurer

run 'apt-get update' in quiet mode when starting from cron

parent 19938388
......@@ -242,6 +242,12 @@ __PACKAGE__->register_method({
optional => 1,
default => 0,
},
quiet => {
type => 'boolean',
description => "Only produces output suitable for logging, omitting progress indicators.",
optional => 1,
default => 0,
},
},
},
returns => {
......@@ -269,6 +275,8 @@ __PACKAGE__->register_method({
my $cmd = ['apt-get', 'update'];
push @$cmd, '-qq' if $param->{quiet};
print "starting apt-get update\n";
PVE::Tools::run_command($cmd);
......
......@@ -44,7 +44,7 @@ if (my $info = PVE::INotify::read_file('subscription')) {
# We assume that users with subscriptions want informations
# about new packages.
if ($info->{status} eq 'Active') {
eval { PVE::API2::APT->update_database({ node => $nodename, notify => 1 }); };
eval { PVE::API2::APT->update_database({ node => $nodename, notify => 1, quiet => 1 }); };
if (my $err = $@) {
syslog ('err', "update apt database failed: $err");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment