Skip to content

Instantly share code, notes, and snippets.

@andrew-smart
Created February 27, 2015 10:54
Show Gist options
  • Select an option

  • Save andrew-smart/82c3d89fa1f2be2cef73 to your computer and use it in GitHub Desktop.

Select an option

Save andrew-smart/82c3d89fa1f2be2cef73 to your computer and use it in GitHub Desktop.
Expose a modules crontab schedule to system configuration (Magento 1.x)
<?xml version="1.0"?>
<config>
...
<crontab>
<jobs>
<[namespace]_cron>
<schedule>
<!--
/**
*
* The magic.
* Exposes the schedule to system config.
*
* Now you can add system config for your module
* and change the schedule as you see fit.
*
*/
-->
<config_path>path/to/config_var</config_path>
</schedule>
<run>
<model>[namespace]/observer::method</model>
</run>
</[namespace]_cron>
</jobs>
</crontab>
...
<default>
<path>
<to>
<config_var>0 * * * *</config_var>
</to>
</path>
</default>
...
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment