CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Add option so scripts run in quiet mode
Pages: [1]

Author Topic: Add option so scripts run in quiet mode  (Read 1371 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Add option so scripts run in quiet mode
March 02, 2011, 06:06:37 pm
A lot of folks run the 'bin' scripts from cron. Now cron sends an email to an administrator account if the command it ran produced any output.

The problem is that when EmailProcessor.php is set to run every few minutes, hundreds of emails can be generated each day.

Can we change the scripts to add a quiet mode which only produces output if there is an error or something unusual. (I have in mind EmailProcessor.php 'ignoring' an incoming email, which is not an error but might be an event an administrator is interested in.)

Thanks,
Ken

(One way of doing this is to have a 'high water mark'. So rather than writing messages to standard output, write the message to a file and specify an error level (Information, Warning, Error, Fatal). When running the program specify the error level that will cause the script to write this file to standard output. The script tracks the 'high water mark' for the error level. So if you specify 'Error' as the high water mark, the output only gets printed if there are any Errors or Fatal errors. The output file is deleted when the script ends.)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Add option so scripts run in quiet mode

This forum was archived on 2017-11-26.