I am using Codeigniter for my website. I have to use cron job to run one of controller function. I am using route in website. And also I am not using index.php in url.
You can also try:
0 * * * * /usr/bin/curl --silent --compressed http://my-domain.com/welcome/show
Or localhost
0 * * * * /usr/bin/curl --silent --compressed http://localhost/welcome/show
I hope that is helpful.
I have done it as
00 09-18 * * 1-5 /usr/bin/php /var/www/html/app/index.php crontest
crontest is the name of the controller which also uses a model to pull data from the database and send mail periodically (between 9 AM to 6 PM on Monday to Friday every week)
I just viewed this page which explains very detail with example. Hope this will be useful to others as well.
You can try with this one:
wget api.example.com/index.php/controller/function
I have used below cron
php /full-path-to-cron-file/cron.php /test/index
source: http://www.asim.pk/2009/05/14/creating-and-installing-crontabs-using-codeigniter/
This works for me.
Thanks to all
/usr/local/bin/php /home/username/public_html/index.php controllername methodname
This worked for me.
watch -n60 curl [your application path]/check_banalce/user_balance
in my case im using codeigniter and the above command executes the user_balance function which is found in check_balance controller every 60 sec.