We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Plugin to Access Cron | Forum

Purusothaman Ramanujam
I am developing a plugin. I need to run a cron often to make my plugin work perfectly.

How can I invoke oxwall cron for my plugin.
Purusothaman Ramanujam
I created a cron.php file in the plugin folder and added some code by taking other plugins as reference.

Is there anything else to do for the plugin specific cron to work ?
Purusothaman Ramanujam
The question here is how to do cron jobs specific for my plugin.
Purusothaman Ramanujam
When I involve run() method, cron is working.

I want to schedule the plugin cron based on the time/hour provided by the user. How can I do this?

EX: Daily or Weekly or Monthly based on Day and Time provided by user.

The Forum post is edited by Purusothaman Ramanujam May 15 '12
Purusothaman Ramanujam
Any help? It's me only posting in this topic. No help from Oxwall team. :(
Sardar
Sardar May 17 '12
You can easily specify the period of your cronjob using parameter in `addJob` method. Period should be specified in minutes. Examples:


// once a day

$this->addJob('checkPluginUpdates', 60 * 24); 


// every minute 

$this->addJob('deleteExpiredOnlineUserProcess', 1);

Purusothaman Ramanujam
How about the following cases:

in a particular day of a month(2nd day of every month at 6 PM)
in a particular day of a week(Tuesday 8 PM every week)
Michael I.
Michael I. Dec 21 '12
Topic was moved from Plugins.