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

This commit is contained in:
Dietmar Maurer
2013-08-02 06:15:20 +02:00
parent 1993838867
commit 8c4384941e
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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");
}