mysqldump | gzip > not working
In my code:
Code:
$command = 'C:\xampp\mysql\bin\mysqldump --host='.$host.' --user='.$user.' --password='.$pass.' --all-databases | gzip > databasebackup.sql.gz';
system($command);
does not work. It creates the file databasebackup.sql.gz but when I try to open it I get "Invalid archive directory"
If I leave just $command = 'C:\xampp\mysql\bin\mysqldump --host='.$host.' --user='.$user.' --password='.$pass.' --all-databases > databasebackup.sql'; it works.
It creates the file databasebackup.sql and I can open it without a problem.
Any ideas what is wrong?
Re: mysqldump | gzip > not working
Since you're using XAMPP, that means you don't have Linux and that you cannot use gzip from the command line like that.