Freepbx CronJobs

Hi All ,

Can someone help me to disable the freepbx/asterisk cronjobs once and for all , I don’t need any module updates

Thank You in Advance

Just disable automatic updates on the Updates module.

Thank you for your reply but I did that but nothing helps and to be more specified , I don’t want these entries :

          • [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
  • 2 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
    35 20 * * 6 [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1

Those are jobs needed by FreePBX so do it at your own risk. Edit the crontab jobs by running ‘crontab -u asterisk -e’

Yes ,but after fwconsole reload they are written again inside asterisk cron file , how to disable this from the source

You can not disable those. The module will put them back. They are needed for proper function of FreePBX.

1 Like

Is there a specific issue you are attending to resolve by removing all cron jobs?

I have a node with 50 container running asterisk and freepbx and when these cronjobs are running make the CPU Load getting high and by digging and I didn’t find any service doing that except these cronjobs , I know these cronjobs are nothing but just imagine that 50 container doing these cronjobs every min .

I don’t see any cron job being run more than once a day. One at midnight, one at 2 am, and one only once a week, at 8:35 pm on Saturdays.

(Hint mark up things like this as pre-formatted text, in future:

* 0 * * *        [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
* 2 * * *         /usr/sbin/fwconsole util cleanplaybackcache -q
35 20 * * 6      [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
[ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

I’ve had to use spaces for tabs.)

Are cron jobs the only problem you are facing?

If you were running a current version of FreePBX, the cron jobs would look like this:

* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

The task sleeps for a random number of seconds before firing to prevent all instances from running simultaneously on the same host.

1 Like

Unfourenlty yes

Can you explain further please ?
what do you mean to sleep before firing ?

FreePBX will run the ‘fwconsole jobs’ at random times between 30s time ranges to prevent this type of situations.

If you are adamant, crontab -e -u asterisk to your preference then, as root,

chattr +i /var/spool/cron/crontabs/asterisk

1 Like

I moved some asterisk crontabs to the fwconsole job the last week. It concerns about 6 modules. Just wait the next updates.
fwconsole Jon --run is randomized so, it should not execute jobs in same time.

* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

Maybe update your modules.

1 Like

Thank you Dicko , as this will be the only solution for now till the next update

Are these updates are available now ?

Not yet. Need to be merged and validate by QA team and next they will be published on stable.
Just check updateing your system often.

1 Like

OK , Thank You Franck