[ask] cron or crontab?

hi all, i want to ask how use crontab step by step from the first time.

i just read from this link

yii-crontab extension

and it error said that no table1, and i don’t know where to put the code below Usage

See the following code example

and i read this http://www.yiiframework.com/wiki/91/implementing-cron-jobs-with-yii

and i din’t know where is crontab.

in example i made this console (in commands\TestCommand.php):


class TestCommand extends CConsoleCommand


	public function run($args)



		echo "test test test";



and i have a console.php in htdocs\myfolder



// change the following paths if necessary



// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);



and in (config\console.php)


// This is the configuration for yiic console application.

// Any writable CConsoleApplication properties can be configured here.

return array(


	'name'=>'My Console Application',

	// application components













		// uncomment the following to enable the Gii tool






		'userClass'=>'Users',//class tablenya








		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.





	// application components





                        'loginUrl' => array('/user/login'),






		// uncomment the following to enable URLs in path-format












			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',


		// uncomment the following to use a MySQL database



			'connectionString' => 'mysql:host=localhost;dbname=cbc',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => '',

			'charset' => 'utf8',

			'tablePrefix' => 'tbl_',




			// use 'site/error' action to display errors










					'levels'=>'error, warning',


				// uncomment the following to show log messages on web pages












	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']


		// this is used in contact page




i want to make the TestCommand do the task every ten minute, and it write the log to the log file

i really new with this, can someone help me?


Are you familiar with unix cron? You can read about it here: http://en.wikipedia.org/wiki/Cron

Next step is to add a task using unix shell (command line):

crontab -e

Add the following line:

*/10 * * * * php /path/to/console.php test

Save & exit & enjoy :)

i using windows

where to put the crontab -e? i put it in commandline but it said this ‘crontab’ is not recognized as an internal or external command, operable program or batch file.

oh, crontab is a linux command. I don’t use Windows as a server, but there should be something similar ::)

owh ok, thanks for the help