require("site.phtml"); check_auth(); $opts = array(); $opts[] = "/bin/mysqldump"; $opts[] = "/usr/bin/mysqldump"; $opts[] = "/usr/local/bin/mysqldump"; $d = ""; foreach ($opts as $path) { if (file_exists($path)) { $d = $path; } } if (empty($d)) { admin_header("Could not find mysqldump executable"); ?> Sorry, we cannot begin this backup because the mysqldump executable was not located. admin_footer(); exit; } admin_header("Backup"); $tmp_name = "/tmp/$db_db-" . date("ymd") . ".sql"; $cmd = "$d -e --user=$db_user --password=$db_pw $db_db > $tmp_name"; $res = `$cmd`; if ($res != 0) { ?> Could not perform backup.
= $res; ?>} else { ?> Filename: = $tmp_name; ?>
Download } admin_footer(); ?>