Cron job on FreePBX 17

Hi This worked on FreePBX 16. Can you advise how to make it work on 17?
For daily “core reload”. (The reason is that sometimes provider server would go down overnight and this was the simplest way to ensure re-connection each day)
In FBPX16 I had in /var/spool/cron/asterisk
0 4 * * * /usr/bin/asterisk-x “core reload”

I’ve tried putting that line (testing with * * * * *) in the same place, but also in /var/spool/cron/crontabs/asterisk which is where other cron jobs are stored
(here is part of that file with my line at the bottom)

* 2 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
14 10 * * 6 [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
14 12 * * 6 [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma upgradeall --sendemail -q > /dev/null 2>&1
* * * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
* * * * * /usr/sbin/asterisk -x "core reload"

Those other commands are showing up in the cronlog. I thought the reload occurring every minute might have been my command, but I removed my “core reload” cron job from both places, and that Reload continues in the cronlog every minute.

2024-08-25T06:12:02.432871+10:00 chromebox-debian crontab[19418]: (asterisk) LIST (asterisk)
2024-08-25T06:13:01.453462+10:00 chromebox-debian cron[432]: (asterisk) RELOAD (crontabs/asterisk)
2024-08-25T06:13:01.469349+10:00 chromebox-debian CRON[20192]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null)
2024-08-25T06:13:01.472144+10:00 chromebox-debian CRON[20191]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole queuestats --syncall >> /var/log/asterisk/queuestats_syncall.log 2>&1)

Any suggestions where to put this cron line? Or does it need something different in FpbX17?

* * * * * = every minute
20 4  * * * = 4:20 every morning

Thanks for that Dicko. I’m just running it every minute while I’m trying to test it. I will change it back once I get it working.

Actually, I thought I was putting the command in /var/spool/cron/crontabs/asterisk
but I’ve just realised it is not saving there. Is this a permission issue? And can I create a separate file somewhere (In that directory?) that will run as a cron in asterisk?
thanks

This is a Debian question, not a FreePBX one.

Are you directly manipulating the file? If so you need to manipulate it using crontab, so that cron gets informed of changes.

Just found that, too, thanks.
Solution was here:

never copy into outgoing even if timestamped in the future unless using -p or -l , much safer to move a complete .call file to outgoing

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.