]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
run 'apt-get update' in quiet mode when starting from cron
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Aug 2013 04:15:20 +0000 (06:15 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Aug 2013 04:15:20 +0000 (06:15 +0200)
PVE/API2/APT.pm
bin/cron/daily/pve

index ff7408ece81841cb4626b90006fbcdb0c1a0c265..844aacb2d10a8cc2a7d991602a716ee317a8b030 100644 (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);
index 1f9de94a07d584a14d4d9772c2d1e9a4b926a860..9db40681baf3e488f6e9e6eeb9b3e2c302c325c4 100644 (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");
        }