amazon web services - Elastic Beanstalk and Cron tasks not sure if its working with Yii -


i having problem getting simple cron task set on elastic beanstalk. have found of other questions on here useful, still can't seem cron execute. unsure if aws issue, or if script not executing. script set inside yii console command. not finding php errors, , ec2 instance loaded without errors. here have done far:

i have created folder on root of application called .ebextensions.

within folder have created configuration file contents

# installing dos2unix in case files edited on windows pc  packages:      yum:         dos2unix: []  container_commands:      01-command:         command:         dos2unix -k cron_setup.sh       02-command:         command:         chmod 700 cron_setup.sh       03-command:          command:        "cat .ebextensions/cron_task.txt > /etc/cron.d/cron_task && chmod 644 /etc/cron.d/cron_task"          # leader_only prevents problems when eb auto-scales          leader_only:    true 

the file cron_task.txt exists inside .ebextensions folder contents

    # newline @ end of file extremely important.  cron won't run without it. * * * * *  /bin/php /var/www/html/crons.php test  > /dev/null 

crons.php file @ root of application includes yii framework

defined('yii_debug') or define('yii_debug',true);  // including yii require_once(dirname(__file__).$yii.'/yii.php');  // we'll use separate config file $configfile=dirname(__file__).'/protected/config/cron.php';  // creating , running console application yii::createconsoleapplication($configfile)->run(); 

the config/cron.php file setup file framework, includes database connection , model inclusions, etc

and cron script being referenced in cron_task.txt file console command looks this

class testcommand extends cconsolecommand {     public function run($args) {         $message = new crontasks();         $message->timestamp = date("y-m-d h:i:s");         $message->message = "test";         $message->insert();     } } 

here trying record database prove cron executed successfully. , can't seem record added.

the problem is, don't know failing. not getting instance errors. , took snapshot log , cant seem find relevant errors in there either. should php errors logged here? or have set myself log errors? problem, having trouble getting ec2 via ssh. getting permission denied (public key) error!! though have set security group/key pair , using correct public dns instance!

if can see obvious im doing wrong here, please let me know! otherwise give advice on errors might preventing cron task execute? many thanks!!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -