I am having a challenge with my database automated backups.
Each time I run the backup command from the system the files are saved as 20B files yet the files are larger than that.
I am experiencing the issue only in the production environment(Centos 7), my localhost is Okay.
This was initially working but after a series of updates on the server it stopped working, I am not sure why.
Below is the backup snippet(Laravel PHP):
//set filename with date and time of backup
$file_name = Carbon::now()->format('Y-m-d-H-iA') . ".sql.gz";
$file_path = $this->file_storage_dir . "/" . $file_name;
File::ensureDirectoryExists($this->file_storage_dir);
//mysqldump command with account credentials from .env file and file path
$command = "mysqldump --column-statistics=0 --user=" . $username . " --password=" . $password . " --host=" . $host . " --all-databases | gzip -c > " . $file_path;
$return_status = null;
$dump_output = null;
//exec command allows you to run terminal commands from php
exec($command, $dump_output, $return_status);