run 'apt-get update' in quiet mode when starting from cron
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user