X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=application-src%2Famlog-script.pl;h=015e3df8efb50866a86b99a6443407e6e59e59e4;hb=d28952249e392eb31bc8eecc53f6c477f30c617b;hp=6504cb44e53ca3c965870dada08964465e90fd46;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;p=debian%2Famanda diff --git a/application-src/amlog-script.pl b/application-src/amlog-script.pl index 6504cb4..015e3df 100644 --- a/application-src/amlog-script.pl +++ b/application-src/amlog-script.pl @@ -1,9 +1,10 @@ #!@PERL@ -# Copyright (c) 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved. # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -86,6 +87,13 @@ sub command_support { #define a execute_on_* function for every execute_on you want the script to do #something +sub command_pre_amcheck { + my $self = shift; + + $self->setup(); + $self->log_data("pre-amcheck"); +} + sub command_pre_dle_amcheck { my $self = shift; @@ -100,6 +108,13 @@ sub command_pre_host_amcheck { $self->log_data("pre-host-amcheck"); } +sub command_post_amcheck { + my $self = shift; + + $self->setup(); + $self->log_data("post-amcheck"); +} + sub command_post_dle_amcheck { my $self = shift; @@ -114,6 +129,13 @@ sub command_post_host_amcheck { $self->log_data("post-host-amcheck"); } +sub command_pre_estimate { + my $self = shift; + + $self->setup(); + $self->log_data("pre-estimate"); +} + sub command_pre_dle_estimate { my $self = shift; @@ -128,6 +150,13 @@ sub command_pre_host_estimate { $self->log_data("pre-host-estimate"); } +sub command_post_estimate { + my $self = shift; + + $self->setup(); + $self->log_data("post-estimate"); +} + sub command_post_dle_estimate { my $self = shift; @@ -142,6 +171,13 @@ sub command_post_host_estimate { $self->log_data("post-host-estimate"); } +sub command_pre_backup { + my $self = shift; + + $self->setup(); + $self->log_data("pre-backup"); +} + sub command_pre_dle_backup { my $self = shift; @@ -156,6 +192,13 @@ sub command_pre_host_backup { $self->log_data("pre-host-backup"); } +sub command_post_backup { + my $self = shift; + + $self->setup(); + $self->log_data("post-backup"); +} + sub command_post_dle_backup { my $self = shift; @@ -210,11 +253,12 @@ sub log_data { my($function) = shift; my $log; + my $text = $self->{'text'} || ""; open($log, ">>$self->{logfile}") || $self->print_to_server_and_die( "Can't open logfile '$self->{logfile}' for append: $!", $Amanda::Script_App::ERROR); - print $log "$self->{action} $self->{config} $function $self->{execute_where} $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), " $self->{text}\n"; + print $log "$self->{action} $self->{config} $function $self->{execute_where} $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), " $text\n"; close $log; }