I have this line of php backing up my databases, work's like a charm (Windows 7):
$exec_str = "{$real_path}Bin\mysqldump -h {$mysql_db_host} -u {$mysql_db_user} -p{$mysql_db_pasw} {$db_name} > {$backupdir}\\{$db_name}.sql";
But i would rather prefer to have the .sql files compressed with 7zip (as 7z)
This one will not work (path to 7za.exe is correct) Instead it generates empty 7z files:
$exec_str = "{$real_path}Bin\mysqldump -h {$mysql_db_host} -u {$mysql_db_user} -p{$mysql_db_pasw} {$db_name} | {$real_path}7za a > {$backupdir}\\{$db_name}.sql.7z";
What am i doing wrong?