From 641cb3bc12271772fdc169ccf3c91430dac27bd0 Mon Sep 17 00:00:00 2001
From: redray <redray@ispconfig3>
Date: Sun, 21 Dec 2008 07:35:58 -0500
Subject: [PATCH] cron errors got to logfile now and are available in monitor-section

---
 install/lib/installer_base.lib.php |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index a62e1d9..5e6b42f 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1042,9 +1042,12 @@
 			if(stristr($val,'/usr/local/ispconfig')) unset($existing_root_cron_jobs[$key]);
 		}
 		
+        // Crontab must end with an empty line or comment!
 		$root_cron_jobs = array(
-			'* * * * * /usr/local/ispconfig/server/server.sh > /dev/null',
-			'30 00 * * * /usr/local/ispconfig/server/cron_daily.sh > /dev/null'
+		    '# --- ISPConfig ----',
+			'* * * * * /usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/var/log/ispconfig/cron.log',
+			'30 00 * * * /usr/local/ispconfig/server/cron_daily.sh > /dev/null 2>> /var/log/var/log/ispconfig/cron.log',
+		    '# ------------------'
 		);
 		foreach($root_cron_jobs as $cron_job) {
 			if(!in_array($cron_job."\n", $existing_root_cron_jobs)) {
@@ -1061,7 +1064,12 @@
 			exec('crontab -u getmail -l > crontab.txt');
 			$existing_cron_jobs = file('crontab.txt');
 		
-			$cron_jobs = array('*/5 * * * * '.$cf['program'].' -g '.$cf['config_dir'].' -r '.$cf['config_dir'].'/*.conf > /dev/null');
+            // Crontab must end with an empty line or comment!
+			$cron_jobs = array(
+    		    '# --- ISPConfig ----',
+                '*/5 * * * * '.$cf['program'].' -g '.$cf['config_dir'].' -r '.$cf['config_dir'].'/*.conf > /dev/null 2>> /var/log/var/log/ispconfig/cron.log',
+    		    '# ------------------'
+            );
 		
 			// remove existing ispconfig cronjobs, in case the syntax has changed
 			foreach($cron_jobs as $key => $val) {

--
Gitblit v1.9.1