I have an export profile on magento 1.6 and I can run it manually (\"Run profile in popup\"), but I need it to run automatically every day. Is there a way to set up a cron job t
I used the following taken from (note: broken link, code is copied below):
http://www.premasolutions.com/content/magento-dataflow-exportimport-form-command-line
setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$profile = Mage::getModel('dataflow/profile');
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(0);
Mage::getSingleton('admin/session')->setUser($userModel);
$profile->load($profileId);
if (!$profile->getId()) {
Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id');
}
Mage::register('current_convert_profile', $profile);
$profile->run();
$recordCount = 0;
$batchModel = Mage::getSingleton('dataflow/batch');
echo "EXPORT COMPLETE. BATCHID: " . $batchModel->getId();
It worked properly on 1.5.x (not tested yet on 1.6.x, sorry).
If it works, it's only matter of scheduling a cron job to call the script automatically.
Regards, Alessandro