X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famcleanup.pl;h=eb1730fc5540ea042d0e6dc5615c97584815fe18;hb=c16b04cb8ba646250049afa94e22e7a800b94e7d;hp=2ee337790e57a5b6d59a2ddc97830852eba7109d;hpb=d5853102f67d85d8e169f9dbe973ad573306c215;p=debian%2Famanda diff --git a/server-src/amcleanup.pl b/server-src/amcleanup.pl index 2ee3377..eb1730f 100644 --- a/server-src/amcleanup.pl +++ b/server-src/amcleanup.pl @@ -19,6 +19,7 @@ use lib '@amperldir@'; use strict; +use warnings; use Getopt::Long; use Amanda::Config qw( :init :getconf config_dir_relative ); @@ -26,6 +27,7 @@ use Amanda::Util qw( :constants ); use Amanda::Paths; use Amanda::Constants; use Amanda::Process; +use Amanda::Logfile; my $kill_enable=0; my $process_alive=0; @@ -70,7 +72,6 @@ Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER); my $logdir=config_dir_relative(getconf($CNF_LOGDIR)); my $logfile = "$logdir/log"; my $amreport="$sbindir/amreport"; -my $amlogroll="$amlibexecdir/amlogroll"; my $amtrmidx="$amlibexecdir/amtrmidx"; my $amcleanupdisk="$amlibexecdir/amcleanupdisk"; @@ -155,7 +156,10 @@ sub run_system { if (-f $logfile) { Amanda::Debug::debug("Processing log file"); run_system(0, $amreport, $config_name, "--from-amdump"); - run_system(1, $amlogroll, $config_name); + + my $ts = Amanda::Logfile::get_current_log_timestamp(); + Amanda::Logfile::log_rename($ts); + run_system(1, $amtrmidx, $config_name); } else { print "amcleanup: no unprocessed logfile to clean up.\n";