make groupofficecli.php quiet

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

Posts: 31
Joined: Tue Oct 26, 2010 2:41 pm

make groupofficecli.php quiet

Postby s.dietrich » Tue Feb 12, 2013 1:02 pm

we now use the "cron" to do regular jobs.
As we enable the cornjob in the crontab, the system administrator get's every time an email with the content

Code: Select all

Group-Office CLI - Copyright Intermesh BV.

That's an annoying message because the cron shell send errors and not a message, which program was called just now.
So we fix this and made a patch:

Code: Select all

--- groupofficecli.php	2013-02-12 13:48:37.172139446 +0100
+++ groupofficecli.php-new	2013-02-12 13:48:16.259653777 +0100
@@ -16,7 +16,8 @@
 require_once($root . 'go/GO.php');
-echo "\nGroup-Office CLI - Copyright Intermesh BV.\n\n";
+if (! isset($args['q']))
+    echo "\nGroup-Office CLI - Copyright Intermesh BV.\n\n";
 if (PHP_SAPI != 'cli')
 	exit("ERROR: This script must be run on the command line\n\n");
Now we can add the option -q and the cronjob works very well.

Thanks and best regards.
Site Admin
Site Admin
Posts: 8235
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch

Re: make groupofficecli.php quiet

Postby mschering » Thu Feb 14, 2013 1:48 pm

Thanks, I've added this to the main code.
Best regards,

Merijn Schering

Who is online

Users browsing this forum: Bing [Bot] and 4 guests