In fact that I am too poor to buy a server to run my website, but I want to run cron auto, so I use ajax to do it! :P
In the file of the layout, add the code as below:
url:"<?php echo Yii::app()->createUrl("/site/cron");?>",
in the path /site/cron, you can write some code to do what you want. :)
Have fun with Yii!