"; $h = &open_console(); # Clear messages &console_cmd($h, "messages"); # Select the job to run &sysprint($h->{'infh'}, "run\n"); &wait_for($h->{'outfh'}, 'run\\n'); $rv = &wait_for($h->{'outfh'}, 'Select Job.*:', 'OK to run.*:'); print $wait_for_input; if ($rv != 1) { # Only need to enter a job if there is more than one if ($rv == 0 && $wait_for_input =~ /(\d+):\s+\Q$in{'job'}\E/) { &sysprint($h->{'infh'}, "$1\n"); } else { &job_error($text{'backup_ejob'}); } # Say that it is OK $rv = &wait_for($h->{'outfh'}, 'OK to run.*:'); print $wait_for_input; } if ($rv == 0) { &sysprint($h->{'infh'}, "yes\n"); } else { &job_error($text{'backup_eok'}); } print "
"; while(1) { $out = &console_cmd($h, "messages"); if ($out !~ /You\s+have\s+no\s+messages/i) { print $out; } if ($out =~ /Termination:\s+(.*)/) { $status = $1; last; } sleep(1); } print "
\n"; } else { print "",$text{'backup_failed'},"
\n"; } } else { # Let it fly print "",$text{'backup_running2'},"
\n"; } &close_console($h); &webmin_log("backup", $in{'job'}); &ui_print_footer("backup_form.cgi", $text{'backup_return'}); sub job_error { &close_console($h); print "\n"; print "",@_,"
\n"; &ui_print_footer("backup_form.cgi", $text{'backup_return'}); exit; }