I am having one problem that how can I run the task defined in my component controller with cron at after some time interval. If someone has any suggestion how to do that please help.
Its same as run the controller task via form action url like below.
index.php?option=com_mycomponent&task=mycontroller.task_name
Normally you can set the action url of form like above or with hidden fields for options,task,controller
separately.
The things that you can't do with cron in this case is administrator controller tasks, Because it requires user login. So in such case you have to write those functions in a front end controller that can be access via url.
One security concern is you should include a key for your Cron Jobs like simple param &key=someencrypetd_value
with the url, then decrypt and compare inside your controller task before starting the controller task functionality. This will help you to prevent someone executing your Cron via direct url.
For setting up the Cron Jobs just login to Cpanel->Cron Jobs->set your url.
here url should be full like http://www.yourdomain.com/index.php?option=com_mycomponent&task=mycontroller.task_name&key=yoursecretkey
more about setting Cron with Cpanel
An example command will be look like follows.
wget -O /dev/null "http://www.yourdomain.com/index.php?option=com_users&view=registration&task=registration.UpdateAllShoppers&key=gdyr73501250"
Also time you can set like Minute -0 , Hours - 0 , Day - *, Month -* ,Weekday -*
for executing this on all day at 12:00AM