puia_nicu
Posts: 1
|
| Posted: 07/07/2006, 6:05 AM |
|
can somebody help me?
i want to backup a database in mssql and its backup name i`d like to contain date and time also.
I tried with "datetime" inside of the name of backup name and...
nothin, that function is taken as a name not as a function.
If somebody see this topic ..i`m waiting..
10x
_________________
yours,nick |
 |
 |
martin k.
|
| Posted: 07/07/2006, 10:19 PM |
|
Hello.
Try this:
$host = "localhost";
$user = "";
$pass = "";
$orgi_db = "db1234567";
$new_backup = date("Ymd_Hi") . "_" . $orgi_db;
$path = "/www/htdocs/12345/backups";
system(sprintf(
'mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/'.$new_backup.'.sql.gz',
$host,
$user,
$pass,
$orgi_db,
$path
));
echo '+DONE';
will give you something like this:
20060711_1133_db1234567.sql.gz
greets martin k.
|
|
|
 |
|