#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;
$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;
$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;
$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;
$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;
$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;
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;
}