Tuesday 4 March 2014

To run the Joomla controller task ( via Joomla frontend ) with CronJobs in CPanel

To run the Joomla controller task (via Joomla Frontend) with Cron Jobs (Cron Scheduler) in CPanel, please follow the below instruction.

For security: It's always better to include 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.

In fact, this will help you to prevent someone executing your Cron via direct url.

And, to Set Up Cron Jobs, just login to Cpanel->Cron Jobs->add your url in below format on Command.
// Add the below link into command.
wget -O /dev/null "http://www.yourdomain.com/index.php?option=com_article&view=cronjobs&key=eyJ0eXBl"

// And it would look like below; ( it schedules the job on every 6th of every 2hrs )

*/6 */2 * * * wget -O /dev/null "http://www.yourdomain.com/index.php?option=com_article&view=cronjobs&key=eyJ0eXBl"

//
More about Cpanel CronJobs