2 # Actually execute a backup
4 require './bacula-backup-lib.pl';
5 &ui_print_unbuffered_header(undef, $text{'backup_title'}, "");
8 print "<b>",&text('backup_run', "<tt>$in{'job'}</tt>"),"</b>\n";
13 &console_cmd($h, "messages");
15 # Select the job to run
16 &sysprint($h->{'infh'}, "run\n");
17 &wait_for($h->{'outfh'}, 'run\\n');
18 $rv = &wait_for($h->{'outfh'}, 'Select Job.*:');
19 print $wait_for_input;
20 if ($rv == 0 && $wait_for_input =~ /(\d+):\s+\Q$in{'job'}\E/) {
21 &sysprint($h->{'infh'}, "$1\n");
24 &job_error($text{'backup_ejob'});
28 $rv = &wait_for($h->{'outfh'}, 'OK to run.*:');
29 print $wait_for_input;
31 &sysprint($h->{'infh'}, "yes\n");
34 &job_error($text{'backup_eok'});
40 # Wait till we have a status
42 print "<b>",$text{'backup_running'},"</b>\n";
45 $out = &console_cmd($h, "messages");
46 if ($out !~ /You\s+have\s+no\s+messages/i) {
49 if ($out =~ /Termination:\s+(.*)/) {
56 if ($status =~ /Backup\s+OK/i && $status !~ /warning/i) {
57 print "<b>",$text{'backup_done'},"</b><p>\n";
60 print "<b>",$text{'backup_failed'},"</b><p>\n";
65 print "<b>",$text{'backup_running2'},"</b><p>\n";
69 &webmin_log("backup", $in{'job'});
71 &ui_print_footer("backup_form.cgi", $text{'backup_return'});
77 print "<b>",@_,"</b><p>\n";
78 &ui_print_footer("backup_form.cgi", $text{'backup_return'});