I have FreePBX 220.127.116.11. I would like to add a cron to run every 5 minutes. I have added a file to /etc/cron.d which contains
*/5 * * * * wget http://www.site.com/script.php -o /dev/null
It doesn’t seem to be running. Please tell me what am I missing here.
Because this is really a Linux question, you’ll get much more support in a linux focused community, like stackexchange.
The first step would be to log the error. Check your crontab to something like this:
*/5 * * * * wget http://www.site.com/script.php >> $HOME/cron.log 2>&1
and then look at the $HOME/cron.log file to see what errors are happening.
figured it out. Thank you.
You can put your orders here also.
**/var/spool/cron/**root (file : root, for any scripts using root privileges)
**/var/spool/cron/**asterisk (file : asterisk, for any scripts using asterisk privileges).
In the case where you’ll get some privileges issues.
Hi. Thank you. I read and read and then tried a few times using putty then crontab -e before I realized what was happening there. Finally got that figured out and then it worked. It’s working right now in fact. I just navigated to var/spool/cron/root and my cron is in there in a file called root. Can I rename that file?
Don’t do that. It’s messing with the system at a level meant for people with a lot more experience than you.
For now, just stick with “crontab -eu <username>”, where <username> is either “root” or “asterisk”.