3 # Run the cron job on all configured servers
5 require './cluster-copy-lib.pl';
7 &ui_print_unbuffered_header(undef, $text{'exec_title'}, "");
9 # Run on all servers and show output
10 $copy = &get_copy($in{'id'});
11 @files = split(/\t+/, $copy->{'files'});
12 $under = $copy->{'dest'} eq "/" ? "" :
13 &text('exec_under', "<tt>$copy->{'dest'}</tt>");
15 print &text('exec_files1', scalar(@files), $under),"<p>\n";
18 print &text('exec_files2',
19 join(", ", map { "<tt>$_</tt>" } @files), $under),"<p>\n";
21 @run = &run_cluster_job($copy, \&callback);
23 print "$text{'exec_nohosts'}<p>\n";
26 &webmin_log("exec", "copy", undef, $copy);
28 &ui_print_footer("edit.cgi?id=$in{'id'}", $text{'edit_return'},
29 "", $text{'index_return'});
31 # callback(error, &server, message, dirs, command-output, before-output)
34 local $d = $_[1]->{'desc'} || $_[1]->{'host'};
37 print "<b>",&text('exec_failed', $d, $_[2]),"</b><p>\n";
41 # Show before command output
42 print "<b>",&text('exec_before', $d),"</b><br>\n";
43 print "<tt>",join("<br>", &mailboxes::wrap_lines($_[6], 80)),
47 # Show created directories
48 print "<b>",&text('exec_made', $d),"</b><br><ul>\n";
49 foreach $f (@{$_[4]}) {
50 print "<tt>$f</tt><br>\n";
56 print "<b>",&text('exec_nothing', $d),"</b><p>\n";
60 print "<b>",&text('exec_success', $d),"</b><br><ul>\n";
61 foreach $f (@{$_[2]}) {
62 print "<tt>$f</tt><br>\n";
68 print "<b>",&text('exec_not', $d),"</b><br><ul>\n";
69 foreach $f (@{$_[3]}) {
70 print "<tt>$f->[0]</tt> : $f->[1]<br>\n";
75 # Show after command output
76 print "<b>",&text('exec_cmd', $d),"</b><br>\n";
77 print "<tt>",join("<br>", &mailboxes::wrap_lines($_[5], 80)),