From 8c4384941eba5199b344f6308b6439c22026cea2 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 2 Aug 2013 06:15:20 +0200 Subject: [PATCH] run 'apt-get update' in quiet mode when starting from cron --- PVE/API2/APT.pm | 8 ++++++++ bin/cron/daily/pve | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm index ff7408ec..844aacb2 100644 --- a/PVE/API2/APT.pm +++ b/PVE/API2/APT.pm @@ -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); diff --git a/bin/cron/daily/pve b/bin/cron/daily/pve index 1f9de94a..9db40681 100644 --- a/bin/cron/daily/pve +++ b/bin/cron/daily/pve @@ -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"); } -- 2.39.2