X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=application-src%2Famlog-script.pl;h=284e68f99aa7abd7e8383ddd709c7244a015656a;hb=911bfb4415195b5c0a98b8c957caa8968313fd81;hp=6504cb44e53ca3c965870dada08964465e90fd46;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;p=debian%2Famanda diff --git a/application-src/amlog-script.pl b/application-src/amlog-script.pl index 6504cb4..284e68f 100644 --- a/application-src/amlog-script.pl +++ b/application-src/amlog-script.pl @@ -86,6 +86,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 +107,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 +128,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 +149,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 +170,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 +191,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 +252,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; }