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 »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Cleaning Up After CRON
Pages: [1]

Author Topic: Cleaning Up After CRON  (Read 3480 times)

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Cleaning Up After CRON
February 25, 2008, 06:19:35 pm
I know almost nothing about CRON jobs, but we do seem to have a CRON job kicking off a new batch of CiviMail emails (20) every 10 minutes.  This is working.

We are on a standard unix shared hosting server and CRON jobs are setup with the cpanel interface.

I ended up with an email that notifies me each time the CRON job runs.  We created a pop3 mail box for user CRON and send the emails there.  Also, there seems to be a file created by CRON in the root directory of the hosting account (one level above the public directory) that has a file size of 0.

So for a run every 10 minutes, that makes for 1,000 emails and 1,000 files in the root directory each week (6 per hour x 24 hours x 7 days).  Not really that big of a deal and now that we are learning to read pop3 emails with php, I suppose we could use a php program to identify any error emails we wish to keep, delete the other emails and delete files of size 0 from the root directory, but I thought I'd ask if this is normal or if  maybe we just did not set things up properly.

Thanks.

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Cleaning Up After CRON
February 26, 2008, 12:55:18 am
You can put a modifier on the end of a cron to suppress reporting. See here http://drupal.org/node/23714 and http://www.adminschoice.com/docs/crontab.htm

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: Cleaning Up After CRON
August 20, 2009, 09:05:36 pm
So..... would we

wget '<mydomain>/drupal/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=loginname&pass=mypassword' >/dev/null 2>&1

Is this the right syntax to eliminate the email? 

Not sure about an example and preferred method for the log file.

We run every 10 minutes, clearing out the emails and log files, while not hard is tedious.

Thanks.  Dave

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Cleaning Up After CRON
August 21, 2009, 02:41:22 am
Quote from: Denver Dave on August 20, 2009, 09:05:36 pm
So..... would we

wget '<mydomain>/drupal/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=loginname&pass=mypassword' >/dev/null 2>&1

Is this the right syntax to eliminate the email? 

Yes, it looks like the right syntax (and the right apporach – if the cron ever misbehaves, or you suspect it to, you just drop the modifier and start receiving the emails with the output as before).

Quote
Not sure about an example and preferred method for the log file.

Try calling wget with the -O /dev/null parameter, as the file might be simply where wget’s writing what it ‘downloaded’.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Cleaning Up After CRON
August 21, 2009, 04:21:23 am
I agree with Piotr and for good measure would add -q which tells wget to be quiet! So the syntax would be:
wget -q -O /dev/null '<mydomain>/drupal/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=loginname&pass=mypassword'


I happen to like curl than wget, so similar syntax for curl would be:
curl -s -o /dev/null '<mydomain>/drupal/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=loginname&pass=mypassword'

I don't see site key in your example syntax.  Are you running an older version of civi of did you just leave it out for simplicity?
Lead Developer, C3 Design.
Twitter: @FatherShawn

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
Re: Cleaning Up After CRON
September 26, 2009, 08:00:21 pm
Can I humbly suggest you check out my post at http://forum.civicrm.org/index.php/topic,8124.msg35119.html#msg35119 which shares my scripts for sending CiviMails and receiving responses? These scripts suppress emails which don't indicate an error.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Cleaning Up After CRON

This forum was archived on 2017-11-26.