Mysql DB backup with mysqldump in PHP?

another_man

New member
Trying to backup my mysql db on another server using php.

some post I found pretend I could use this ;

$command = "mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]";
system($command);

The thing is, I'm not sure that "> backupfile.sql" really do something as I'm not local, but on a web server. So I tried to replace "> backupfile.sql" by "> ftp:// user:pass@ www.domain.com/pathtofile/ backupfile.sql"

(yes I've put some blank space in URL so it won't be converted in post as a URL)

On result,

$command is empty
and the file do not create on my other web server

What I am doing wrong here ?
 
Back
Top