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) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Useful cron job: finding errors
Pages: [1]

Author Topic: Useful cron job: finding errors  (Read 846 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
Useful cron job: finding errors
May 20, 2009, 09:43:56 pm
I'm posting here my cron job for getting notifications about application errors.

I run it each day to give me a list of the application errors which occurred in the last 24 hours.

This is what it does ...
  • Finds all files named either 'error_log' or 'CiviCRM.log'
  • Prints their contents
  • Deletes them (so I don't receive the same error notification twice)
  • (cron emails me the result if it is non-empty)

It works for CiviCRM 2.x running under Joomla! 1.5.x on a Linux server. If you aren't comfortable deleting error files, you could modify the script to archive them.

Code: [Select]
#!/bin/bash
#
# Find files called 'error_log' and 'CiviCRM.log', show their contents, and remove them
# Replace <JOOMLA_ROOT_DIRECTORY> with the absolute directory path to your Joomla! installation
#

find <JOOMLA_ROOT_DIRECTORY> \
    -type f \
    \( -name error_log -o -name CiviCRM.log \) \
        -exec echo "***" "{}" "***" \; \
        -exec cat "{}" \; \
        -exec rm "{}" \; \
        -exec echo " " \;

Ken

(If you find the script useful, please applaud. If you modify the script could you share that via a reply? A useful extension would be to implement the script for Drupal.)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Useful cron job: finding errors
May 22, 2009, 10:30:09 am
thanks for the script :)

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Useful cron job: finding errors

This forum was archived on 2017-11-26.