vaibhav
(vaibhav)
1
FreePBX 16.0.40.7 - Distro Install
Everything is working great but not sure why, Cron is not working.
For testing, I create a very simple cron
touch /tmp/test.txt
chmod 777 /tmp/test.txt
0 * * * * echo "AA" >> /tmp/test.txt
But there is nothing in /tmp/test.txt
What am I missing?
TIA
vaibhav
(vaibhav)
2
Any help on this please. I’m clueless.
Thanks
Anything logged under /var/log/cron
?
vaibhav
(vaibhav)
4
It has these lines
[root@freepbx ~]# tail -f /var/log/cron
Apr 15 21:57:01 freepbx crontab[26895]: (asterisk) LIST (asterisk)
Apr 15 21:57:01 freepbx crontab[26897]: (asterisk) LIST (asterisk)
Apr 15 21:57:02 freepbx crontab[26945]: (asterisk) LIST (asterisk)
Apr 15 21:57:02 freepbx crontab[26947]: (asterisk) LIST (asterisk)
Apr 15 21:57:02 freepbx crontab[26949]: (asterisk) LIST (asterisk)
Apr 15 21:57:02 freepbx crontab[26950]: (asterisk) REPLACE (asterisk)
Apr 15 21:57:02 freepbx crontab[26952]: (asterisk) LIST (asterisk)
Apr 15 21:57:02 freepbx crontab[26954]: (asterisk) LIST (asterisk)
Apr 15 21:57:03 freepbx crontab[26955]: (asterisk) REPLACE (asterisk)
Apr 15 21:57:03 freepbx crontab[26957]: (asterisk) LIST (asterisk)
Apr 15 21:58:01 freepbx crond[14741]: (asterisk) RELOAD (/var/spool/cron/asterisk)
Apr 15 21:58:01 freepbx CROND[27065]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole queuestats --syncall >> /var/log/asterisk/queuestats_syncall.log 2>&1)
Apr 15 21:58:01 freepbx CROND[27066]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null)
Apr 15 21:58:02 freepbx crontab[27097]: (asterisk) LIST (asterisk)
Apr 15 21:58:02 freepbx crontab[27099]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27146]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27148]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27150]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27151]: (asterisk) REPLACE (asterisk)
Apr 15 21:58:16 freepbx crontab[27153]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27155]: (asterisk) LIST (asterisk)
Apr 15 21:58:16 freepbx crontab[27156]: (asterisk) REPLACE (asterisk)
Apr 15 21:58:16 freepbx crontab[27158]: (asterisk) LIST (asterisk)
Its filled with this… I’m clueless what is the LIST & REPLACE about.
Any help is appreciated.
TIA
vaibhav
(vaibhav)
5
Some more input if it helps:
[root@freepbx ~]# ll /var/spool/cron/
total 8
-rw------- 1 asterisk asterisk 1003 Apr 15 22:11 asterisk
-rw------- 1 root root 114 Apr 13 13:48 root
[root@freepbx ~]#
[root@freepbx ~]# cat /var/spool/cron/root
0 * * * * root php -q /usr/local/parseloglite/parselog.php convertlocal
0 * * * * root echo "BB" >> /tmp/test.txt
[root@freepbx ~]#
Nothing getting appended in /tmp/test.txt
Hmm, the root document on my deployment is empty. Have you tried adding the same line to the asterisk document?
Make sure the asterisk user/group has write access to your test.txt file.
vaibhav
(vaibhav)
7
I first executed the below command as “root” and it created the root file.
cron -e echo "BB" >> /tmp/test.txt
Then I did the same using asterisk user and it added to the asterisk file but it did not work.
Make sure the asterisk user/group has write access to your test.txt file.
This suggestion of your solved the issue.
Thanks a ton buddy !!!