Multiple freepbx-cron-scheduler.php running

How is this corrected?

Multiple freepbx-cron-scheduler.php running

Bill

hmm - not sure how that would happen. I’m not looking at the code right now. You can try disabling update checking from the General screen and then re-enabling it - but I don’t think that will do anything. You may just have to delete one manually.

crontab -eu asterisk

then delete one. (You need to be root above to do that).

FYI…

This is a fresh install. Loaded the latese stable trixbox, then upgraded
to freePBX RC1. Maybe the original cron entry didn’t go away. One was at h+36 the other at h+56.

Oh well…

Bill

Bill,
it may be too late to check, but I just looked at the code and it should have detected that there were multiple jobs and informed you in the dashboard, did you notice that by any chance? (It deletes the error once back to normal so it would no longer be there).

p

just tested it - the error reporting does work. At this point FreePBX does not do anything to correct the error. The job is only created in one place in retrieve_conf so I’m not sure how it created to but I would venture to guess that there is either a bug somewhere? Were the both user asterisk or was one root or something else? That is the only explanation I could currently think of?

You Know…I was doing about 10 things when I loaded it, so given your explanation, it’s highly likely that I screwed something up. I guess we can chalk this one up to a short between the keyboard and the chair…or an ID-10-T error.

Thanks
Bill

Below is example of the cron errors experienced and resolution.

ERROR RECEIVED**********
There were 4 freepbx-cron-scheduler.php instances running. There should be only 1.
Added 1 minute ago
(retrieve_conf.CRONMGR)


RESOLUTION

STEP 1 EXPORT YOUR FAVORITE TXT EDITOR ( I prefer nano for ease can use vi )

[trixbox1.localdomain ~]# export EDITOR=nano

STEP 2 BRING UP CRONTAB CONFIGURATION
[trixbox1.localdomain ~]# crontab -eu asterisk

*************CRONTAB SHOWING DUPLICATION ********

NOTE DUPLCATE ENTRIES 7, 1 2 AND 15 2

7 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php
1 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ maintenance
15 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ backup 1
7 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php
1 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ maintenance
15 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ backup 1
7 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php
1 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ maintenance
15 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ backup 1


STEP 3 HIGHLIGHT AND DELETE OR BACKSPACE FROM BOTTOM OF FILE TO REMOVE DUPLICATE
ENTRY. CURRENTLY 1 SET OF CRONTAB ENTRIES "NO DUPLICATES SHOWN " !

7 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php
1 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ maintenance
15 2 * * * /var/www/html/framework/cake/v_1-2-4/cake/console/cake -app /var/www/html/maint/modules/backup/app/ backup 1

STEP 4 MUST SAVE YOUR CHANGES
EXAMPLE BELOW FOR NANO EDITOR

HOLD CTRL KEY ON KEYBOARD THEN PRESS X

RESPONSE " SAVE MOFIFIED BUFFER (ANSWERING “No” WILL DESTROY ALL CHANGES) ?
“ENTER Y YES AND ENTER KEY TO SAVE OR N NO AND ENTER TO ABORT”

Y

FILE Name to Write: /tmp/crontab.XXXXCqjJ4m

HIT ENTER KEY

YOUR FINISHED :wink:

I’m not seeing any errors but this got me curious.
Both root and asterisk have the same cronjob set for different intervals… is this correct?

[code][root@ippbx bin]# crontab -lu root
30 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php

[root@ippbx bin]# crontab -lu asterisk
0 0 * * * /var/lib/asterisk/bin/ampbackup.php 2
9 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php[/code]

ip4ever_ed, that is a trixbox bug, it has nothing to do with FreePBX.

No errors generated is definitely " a very good thing "
Thanks for the enlightenment Martha Stewart !

Backup was originally handled exclusively by AMP before
being supported by FreePBX, this may help explain the additional
cron instance. Most importantly these instances are unique therefore
no conflicts.

My advise - if it aint broke don’t fix it.

I also have 2 freepbx-cron-scheduler jobs running, just as mrgoblin shows on 4/9/11. Should the job be run by root or by asterisk? How can I test that the job succeeds?