From 6ec95189e4d029ee5f8fb288ffe9906956614fce Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 09 Aug 2013 06:52:38 -0400
Subject: [PATCH] Fixed: FS#3053 - Empty sql backups

---
 server/cron_daily.php |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/cron_daily.php b/server/cron_daily.php
index 96f0a93..9c7cad6 100644
--- a/server/cron_daily.php
+++ b/server/cron_daily.php
@@ -1231,7 +1231,8 @@
 				$db_id = $rec['database_id'];
 				$db_name = $rec['database_name'];
 				$db_backup_file = 'db_'.$db_name.'_'.date('Y-m-d_H-i').'.sql';
-				$command = "mysqldump -h '".escapeshellcmd($clientdb_host)."' -u '".escapeshellcmd($clientdb_user)."' -p'".escapeshellcmd($clientdb_password)."' -c --add-drop-table --create-options --quick --result-file='".$db_backup_dir.'/'.$db_backup_file."' '".$db_name."'";
+				//$command = "mysqldump -h '".escapeshellcmd($clientdb_host)."' -u '".escapeshellcmd($clientdb_user)."' -p'".escapeshellcmd($clientdb_password)."' -c --add-drop-table --create-options --quick --result-file='".$db_backup_dir.'/'.$db_backup_file."' '".$db_name."'";
+				$command = "mysqldump -h ".escapeshellarg($clientdb_host)." -u ".escapeshellarg($clientdb_user)." -p".escapeshellarg($clientdb_password)." -c --add-drop-table --create-options --quick --result-file='".$db_backup_dir.'/'.$db_backup_file."' '".$db_name."'";
 				exec($command, $tmp_output, $retval);
 
 				//* Compress the backup with gzip
@@ -1285,8 +1286,7 @@
                 }
 
 				unset($files);
-				unset($dir_handle);
-			}
+				unset($dir_handle			}
 		}
 
 		unset($clientdb_host);

--
Gitblit v1.9.1