So i have this php function path in codeigniter which I am trying to run through cron job in ubuntu. But whatever I have tried it is not working. The command I have tried so far
* * * * * /usr/bin/php http://localhost/QAPIv2/updateTestData
But it is not executing. I am using codeigniter
3
Answers
Please call the function from the command line.
Please change the controller and function according to your code.
To elaborate on Rohan’s answer, you run the functions like
php index.php controller function
. So, for example, to run your script every Tuesday at 8:31AM, your crontab entry should look like :Try this:
First number is time for cron.In function name you should give the controller function name which you want to load in cron.