I installed Magento 1.9, and now since the order emails are sent with cron, I want the cron to run every 1 minute, so the customer gets their emails right away.
But I do not want all the cron tasks every minute, cause it would be a huge resource drain.
How can i set up the order emails to get out every minute, but not the other cron tasks….
I also have installed AOE scheduler
?
Best Answer
We have shops running where the cron script is called every minute and it isn't a problem resource-wise, but this is how you would do it with Aoe_Scheduler by creating separated cron groups:
Create a symlink
cron_email.php
in your Magento root directory which points tocron.php
:ln -s cron.php cron_email.php
Define the normal cronjob for all cron tasks excluding the one sending the mail:
Define the second cronjob which is only responsible for sending the mail:
One advantage you'll get when separating the crons into groups is that long running jobs in the "normal" cronjob won't keep your mails from being sent and vice versa.
As @fschmengler pointed out in the comment you'll have to be cautious when using symlinks and you are on a non-Windows system with
shell_exec
enabled. Here is how we actually do it to avoid problems parallel execution when using symlinks:cron.php
for every cron groupalways
ordefault
The result looks like this:
crontab:
Magento root dir:
This makes things a little bit more complicated but it has served us well.