Cron job with CodeIgniter using wget

1.1k Views Asked by At

I am pretty new to setting up cron jobs. What I've done so far is set one up to run every 5 minutes using the following script:

*/5 * * * * wget -q localhost:8888/example/index.php/controller/function

When I run just the wget part from the command line, it works perfectly. But in the crontab, while the logs show it being ran every 5 minutes, nothing is happening. Am I missing something easy? Any help is appreciated!

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

You can force a particular shell with

SHELL=bash
*/5 * etc...

or whatever in the crontab. Then make sure wget is available in that shell's path.

Otherwise just give an absolute /usr/bin/wget path instead.

*/5 * * * * /usr/bin/wget etc...