I have written a custom import script that reads data from CSV and creates/updates products in my store. The script is scheduled to be executed once per day (in the night) with the cron. This is the cron configuration in the custom module that executes the import
<crontab> <jobs> <custom_import> <schedule> <cron_expr>0 1 * * *</cron_expr> </schedule> <run> <model>custom_import/observer::import</model> </run> </custom_import> </jobs> </crontab>
The process takes a long time to execute (there are about 4000 products to process) and on the production server the max_execution_time is set to 30 (5 minutes) and I can not change it (set_time_limit does not work).
So I need to do the import in another way. I thought that the best way would be to have a 'trigger' script to be executed with cron. Then trigger script would start the import and before the time limit is reached re-run the import process.
I was wondering how this could be achieved in Magento or if there is a better way to do that.