Add option to run post-backup command even if tar fails https://sourceforge.net/p/webadmin/bugs/4605/

This commit is contained in:
Jamie Cameron 2015-09-02 18:19:28 -07:00
parent 31d3aa2782
commit 5856d46c6c
5 changed files with 9 additions and 5 deletions

View File

@ -73,7 +73,7 @@ else {
}
# Execute the post-backup command, if any
if ($ok) {
if ($ok || $dump->{'afteraok'}) {
print "<pre>";
$bok = &execute_after($dump, STDOUT, 1);
print "</pre>\n";

View File

@ -72,7 +72,7 @@ else {
$status{'end'} = time();
&write_file($sfile, \%status);
if ($status{'status'} eq 'complete') {
if ($status{'status'} eq 'complete' || $dump->{'afteraok'}) {
# Execute the post-backup script
$bok = &execute_after($dump, OUT, 0);
if (!$bok && !$dump->{'afterfok'}) {

View File

@ -101,15 +101,17 @@ if ($access{'extra'}) {
# Before and after commands
if ($access{'cmds'}) {
print &ui_table_row(&hlink($text{'dump_before'},"before"),
&ui_textbox("before", $dump->{'before'}, 60)." ".
&ui_textbox("before", $dump->{'before'}, 60)."<br>".
&ui_checkbox("beforefok", 1, $text{'dump_fok'},
!$dump->{'beforefok'}),
3, \@tds);
print &ui_table_row(&hlink($text{'dump_after'},"after"),
&ui_textbox("after", $dump->{'after'}, 60)." ".
&ui_textbox("after", $dump->{'after'}, 60)."<br>".
&ui_checkbox("afterfok", 1, $text{'dump_fok2'},
!$dump->{'afterfok'}),
!$dump->{'afterfok'})."<br>".
&ui_checkbox("afteraok", 1, $text{'dump_aok'},
!$dump->{'afteraok'}),
3, \@tds);
}
print &ui_hidden_table_end();

View File

@ -70,6 +70,7 @@ dump_before=Command to run before backup
dump_after=Command to run after backup
dump_fok=Halt if command fails
dump_fok2=Report failure if command fails
dump_aok=Skip command even if backup fails
dump_extra=Extra command-line parameters
dump_rsh=Remote backup command
dump_rsh0=Default (RSH)

View File

@ -78,6 +78,7 @@ else {
$dump->{'after'} = $in{'after'};
$dump->{'beforefok'} = !$in{'beforefok'};
$dump->{'afterfok'} = !$in{'afterfok'};
$dump->{'afteraok'} = !$in{'afteraok'};
}
$in{'file'} =~ s/^\s+//; $in{'file'} =~ s/\s+$//;
$in{'hfile'} =~ s/^\s+//; $in{'hfile'} =~ s/\s+$//;