Welcome Guest, Not a member yet? Register   Sign In
Cron Job
#1

Hi friends

How to call controller and action using cron job?

my cron action's absolute path is below

/[FOLDER_NAME]/[USERNAME]/public_html/index.php/[CONTROLLER_CRON]/[CONTROLLER_ACTION]

If I set above path in cpanel cron job task than server return path not found error, and also I have created one test file on root than server give permission error.

I am using bluehost shared hosting server

Sorry for my bad English ,please help me
Reply
#2

(This post was last modified: 02-19-2016, 02:47 AM by Krycek.)

Please try

Code:
index.php welcome show

So that would be (changes / for spaces)

Code:
/[FOLDER_NAME]/[USERNAME]/public_html/index.php [CONTROLLER_CRON] [CONTROLLER_ACTION]
Reply
#3

(This post was last modified: 02-19-2016, 02:48 AM by keulu.)

see the doc Smile http://www.codeigniter.com/user_guide/general/cli.html

example.com/index.php/tools/message/to

->

$ cd /path/to/project;
$ php index.php tools message "John"

OR

$ php /path/to/project/index.php tools message "John"
Reply
#4

Thanks to all for valuable reply.

And below code is working for me.
CI uses CLI requests. Means you have to use PHP CLI to use this cron job properly. From SSH in crontab view it should be similar to:


/usr/bin/php-cli /home/[CPANEL_USER]/public_html/index.php [CONTROLLER_NAME] [METHOD_NAME]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB