Imported Upstream version 3.3.0
[debian/amanda] / application-src / amlog-script.pl
index 6504cb44e53ca3c965870dada08964465e90fd46..284e68f99aa7abd7e8383ddd709c7244a015656a 100644 (file)
@@ -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;
 }