Ciao a tutti!
ho trovato questo script per eseguire il backup automatico del database di MySql:
Codice PHP:
<?php
// Enter your MySQL access data
$host= 'xx.xx.xx.xx';
$user= 'XXXXXXX';
$pass= 'XXXXXXXX';
$db= 'XXXXXXXX';
$backupdir = 'backups';
// Compute day, month, year, hour and min.
$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";
// Execute mysqldump command.
// It will produce a file named $db-$year$month$day-$hour$min.gz
// under $DOCUMENT_ROOT/$backupdir
system(sprintf(
'mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/%s/%s-%s%s%s-%s%s.gz',
$host,
$user,
$pass,
$db,
getenv('DOCUMENT_ROOT'),
$backupdir,
$db,
$year,
$month,
$day,
$hour,
$min
));
echo '+DONE';
?>
..ma quando vado ad eseguirlo mi da questo errore:
Warning: system() has been disabled for security reasons in /web/htdocs/www.ssiittoo.me/home/bu_mysql/dobumysql.php on line 42
+DONE
Sapreste dirmi come mai?
Bisogna abilitare la funzione system() da qualche parte?