Cron question

Hey guys -

I am not the linux wiz, so please only flame me a little if this is a dumb question.

If, when logged in as root I run ‘crontab -l’ why do I not see the FreePBX scripts listed.

(The OS is CentOS 4.6)


Because there is a system cron and a user cron. Doing “crontab -l” as root will show you the crontab for the root user. What you probably want to do is edit /etc/crontab directly, which is the “system wide” cron config.

Further, Red Hat/CentOS has several cron.* directories, where you can drop scripts that will run on a periodic basis (controlled by the system cron, if my memory serves.)

I hope that makes sense.

There are also scripts that run under other user account rights, asterisk for example. you can see those by typing: crontab -u asterisk -l

Thanks for the answers. I assume FreePBX runs it’s scripts as Asterisk?

As far as I can see it runs cron jobs as whoever is the Apache user. In a lot cases that will be the asterisk user.

Have you got Webmin installed? Cron, IMHO is one of the areas where using Webmin is quicker and better than the command line. The Webmin module lets you see and work on all user’s cron jobs at once.

I do have webmin installed. I try to avoid using it as I usually get berated by my team. I have a sign on my desk that says ‘gui, we don’t need no stinkin’ gui’

I also pride myself in doing being able to do things faster from the CLI.

Anyway, thanks for the tip I took a look and it is running as Asterisk. It is running a FreePBX php daily.