codice:
function back($tables,$nome)
{
require_once('dbconf.php');
$host= DB_HOST;
$user= DB_USER;
$pass= DB_PASS;
$db= DB_DB;
$backupdir = 'backs';
$today = getdate();
$day = $today['mday'];
if ($day < 10) { $day = "0$day"; }
$month = $today['mon'];
if ($month < 10) { $month = "0$month"; }
$year = $today['year'];
$hour = $today['hours'];
$min = $today['minutes'];
$sec = "00";
exec(sprintf( 'mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/%s/%s-%s%s%s-%s%s.ql', $host, $user, $pass, $db.' '.$tables, getenv('DOCUMENT_ROOT'), $backupdir, $nome, $year, $month, $day, $hour, $min )); return null;}