简体   繁体   中英

Execute a CI controller function via Amazon ec2 cron job

I am trying to execute a codeigniter controller function via amazon ec2 cron job. I have created a new file in /etc/cron.hourly folder. The code of the file is

/usr/bin/php -q http://abc/interface/index.php/xyz/xyz_cron_update/a

But it's not working. I have followed the "Quick Job Setup" from following link https://avastechnology.wordpress.com/2012/12/12/creating-a-new-cron-job-on-aws-linux-ami/

What's going wrong. Thanks in advance.

Need Some more clarification on what cron job you are running. And for running a cron job in codeigniter better use CLI .

Then try this in your cron:

php path-to-your-app/index.php xyz/xyz_cron_update/a  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM