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

Hi friends

How to call controller and action using cron job?

my cron action's absolute path is below


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

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

Please try

index.php welcome show

So that would be (changes / for spaces)


(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



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


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

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]

Theme © iAndrew 2016 - Forum software by © MyBB