\n"; goto donebackup; } } foreach $db (@dbs) { if (!&accepting_connections($db)) { print &text('backup_notaccept', "$db"),"
\n"; next; } if ($in{'all'}) { $dir = &date_subs($in{'path'}); &make_backup_dir($dir) if ($in{'mkdir'}); $path = $dir."/".$db.".".$suf; } else { $path = &date_subs($in{'path'}); } if ($cron && $cmode == 0) { # Run and check before-backup command $bok = &execute_before($db, STDOUT, 1, $path, $in{'all'} ? undef : $db); if (!$bok) { print "$main::whatfailed : ",$text{'backup_ebefore'},"
\n"; next; } } $err = &backup_database($db, $path, $in{'format'}, \@tables, undef, $in{'compress'}); if ($err) { print "$main::whatfailed : ", &text('backup_ebackup',"
$err
\n"; } else { @st = stat($path); print &text('backup_done', "$db", "$path", $st[7]),"
\n"; } &execute_after($db, STDOUT, 1, $path, $in{'all'} ? undef : $db) if ($cron && $cmode == 0); } &execute_after(undef, STDOUT, 1, $in{'file'}, undef) if ($cmode == 1); donebackup: } if ($cron) { &lock_file($cron_cmd); &cron::create_wrapper($cron_cmd, $module_name, "backup.pl"); &unlock_file($cron_cmd); &lock_file(&cron::cron_file($job)); if ($in{'sched'} && !$oldjob) { &cron::create_cron_job($job); $what = "backup_ccron"; } elsif (!$in{'sched'} && $oldjob) { # Need to delete cron job &cron::delete_cron_job($job); $what = "backup_dcron"; } elsif ($in{'sched'} && $oldjob) { # Need to update cron job &cron::change_cron_job($job); $what = "backup_ucron"; } else { $what = "backup_ncron"; } &unlock_file(&cron::cron_file($job)); # Tell the user what was done print $text{$what},"
\n" if ($what); } &webmin_log("backup", undef, $in{'all'} ? "" : $in{'db'}, \%in); if ($in{'all'}) { &ui_print_footer("", $text{'index_return'}); } else { &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, &get_databases_return_link($in{'db'}), $text{'index_return'}); }