Welcome Guest, Not a member yet? Register   Sign In
how to run my function using cron or anything else
#1

[eluser]dhananjay[/eluser]
i have created a function in one of my controller now i want it to run daily.....
i m using hostgator they provide option to set up cron job but there they require path of file , i dont get how i can specify my url to be run.....


Any help will be much appreciated.....
#2

[eluser]Clooner[/eluser]
[execute php filepath] /[codeigniterproject]/index.php controller method
#3

[eluser]PhilTem[/eluser]
This
http://www.adminschoice.com/crontab-quick-reference

plus what @Jeroen Schaftenaar posted above should be some help for you!
#4

[eluser]dhananjay[/eluser]
i m not using index.php in url in config file i have also made it empty string so do i need to include index.php
#5

[eluser]dhananjay[/eluser]
/public_html/clients/the-school-shop/index.php/newsletter/sendnewsletters: No such file or directory

getting this error
#6

[eluser]Clooner[/eluser]
I guess you don't get the concept of a cron job yet Tongue. Cron executes from the command line. If you want to simply call the website use: wget http://websiteyouwanttocall.com/thepage.php but this means anyone can access it. The other more common way is to call php from the command line as described in my post above. There are good tutorials on this online. Please be aware that you call the controller and method as an arguments in the command line interface, this means that you have to use spaces to separate them.
#7

[eluser]dhananjay[/eluser]
so lets i want to create a function to send newsletter how i should do this

or

setting wget where i can do this in my hosting?
#8

[eluser]dhananjay[/eluser]
now i have set this and getting this errror

/bin/sh: public_html/clients/the-school-shop/index.php: Permission denied

have set this in cron

/public_html/clients/the-school-shop/index.php newsletter sendnewsletters
#9

[eluser]Clooner[/eluser]
[quote author="dhananjay" date="1343576896"]now i have set this and getting this errror

/bin/sh: public_html/clients/the-school-shop/index.php: Permission denied

have set this in cron

/public_html/clients/the-school-shop/index.php newsletter sendnewsletters[/quote]

As before you have to call the php executable like so!
Code:
/usr/bin/php /public_html/clients/the-school-shop/index.php newsletter sendnewsletters

again, the php location can differ so contact your host about that one!
#10

[eluser]dhananjay[/eluser]
i had set up it like this php/***/***/public_html/clients/the-school-shop/index.php newsletter sendnewsletters

and i think it called and what i get on my cron job notification is whole home page html of my website but i dont get newsletter in my email......




Theme © iAndrew 2016 - Forum software by © MyBB