So I know how to setup a cron using the config.xml crontab stuff:
A proof of concept. Modify to your needs:
getGroupId();
$cronStringPath = 'crontab/jobs/company_export_send_' . $groupId . '/schedule/cron_expr';
$cronModelPath = 'crontab/jobs/company_export_send_' . $groupId . '/run/model';
$value = $this->getData('groups/' . $groupId . '/fields/cron_setting/value');
Mage::getModel('core/config_data')
->load($cronStringPath, 'path')
->setValue($value)
->setPath($cronStringPath)
->save();
Mage::getModel('core/config_data')
->load($cronModelPath, 'path')
->setValue((string) Mage::getConfig()->getNode($cronModelPath))
->setPath($cronModelPath)
->save();
}
}
and the config.xml:
0.1.0
Company_Export_Model
Company_Export_Helper
Company_Export
Order Export Configuration
company_export/observer::exportOrderData
and system.xml:
99999
feedsconfig
text
10000
1
0
0
text
2
1
0
0
text
company_export/config_cron
40
Use Crontab Format (Eg. "*/5 * * * *" for every 5 minutes)
1
0
0