0

I am using the script below to create an zipped (.tar.gz) .sql file of a mysql database (so I can then back the database file up). The problem is that when the file is created, for some reason the . in .sql and .tar.gz is not written properly and instead appears as a ? mark when I look at the file in terminal or any FTP program. Why is this script not properly creating a dot? Any advice? Could it be a language issue? My server is a VPS from Dreamhost and it's all in English.

Thanks!

<?php
ini_set("memory_limit","40M");

$dbhost = "host..."; 
$dbuser = "user...";
$dbpass = "pass...";
$dbname = "database...";

$backupfile = $dbname . ‘.sql’;
$backupzip = $backupfile . ‘.tar.gz’;
system("mysqldump -h $dbhost -u $dbuser -p$dbpass $dbname > $backupfile");
system("tar -czvf $backupzip $backupfile");

// Delete the unzipped file from the server
unlink($backupfile);

?>
4

1 回答 1

0

it looks like you have some kind of weird single quotation marks around the file extensions. That could be what's causing your problem.

于 2012-07-22T06:07:49.537 回答