Magento 1.9.3 Cron任务异常:自动改为15分钟执行求助
Troubleshooting Magento 1.9.3 Cron Stopping & Frequency Change
Hey there, let's break down this cron issue you're facing—it's a common pain point with Magento 1.9, but we can work through it step by step. The problem could stem from either Magento's backend configuration, server-level restrictions, or even third-party extensions. Let's dive into the possible causes and fixes:
Potential Magento Backend Configuration Issues
Magento has its own built-in cron scheduling logic that can override your server's cron settings if misconfigured:
- Cron Schedule Settings: Head to
System > Configuration > System > Cron (Scheduled Tasks)and check two key fields:Generate Schedules Every: If this is set to 15 minutes, Magento will automatically adjust task intervals to match, even if your server cron is set to run every minute. Set this to 1 minute to align with your desired frequency.Schedule Ahead For: This controls how far in advance Magento generates cron schedules. A value too low (e.g., 1 minute) can cause scheduling gaps; try setting it to 10-15 minutes.
- Clogged
cron_scheduleTable: Magento stores all cron task records in this database table. If it's filled with hundreds of failed/pending tasks, the scheduler can get stuck and stop processing new jobs.- Back up the table first, then run this SQL query to clean up old records:
DELETE FROM cron_schedule WHERE status != 'success' AND created_at < DATE_SUB(NOW(), INTERVAL 7 DAY);
- Back up the table first, then run this SQL query to clean up old records:
- Third-Party Extension Interference: Some extensions (especially those related to scheduling, backups, or indexing) can override Magento's default cron behavior. Try disabling all non-core extensions temporarily and see if the cron resumes normal operation.
Server-Level Issues to Check
Your hosting environment might be modifying or blocking your cron setup:
- Hosting Provider Restrictions: Many shared hosts enforce cron frequency limits (e.g., minimum 15-minute intervals) to prevent resource abuse. If your cron entry keeps reverting to 15 minutes, reach out to your host to confirm if they have such restrictions in place.
- Cron Permissions & Execution:
- Ensure
cron.phpandcron.shhave proper file permissions (755is standard) and that the user running cron (usuallywww-dataor your server's SSH user) has read access to Magento files and write access to thevar/logdirectory. - Test running the cron command manually first to rule out syntax errors:
If you usephp -f /full/path/to/your/magento/cron.phpcron.sh, verify the PHP path inside the script matches your server's CLI PHP path (some servers have multiple PHP versions installed).
- Ensure
- Cron Logs for Errors: Check your server's cron logs to see why tasks might be failing:
- On Debian/Ubuntu:
grep cron /var/log/syslog - On CentOS/RHEL:
grep cron /var/log/messages - Also check Magento's own cron log at
var/log/cron.logfor task-specific errors.
- On Debian/Ubuntu:
- Long-Running Tasks: If a single cron job (like reindexing or a large backup) takes too long to execute, it can block subsequent runs. Monitor task execution times in the
cron_scheduletable'sexecuted_atandfinished_atcolumns.
Step-by-Step Troubleshooting Plan
- First, confirm your Magento backend cron settings are set to 1-minute generation intervals.
- Clean up the
cron_scheduletable and test if cron resumes. - Check your server's cron entry with
crontab -l—if it keeps reverting to 15 minutes, contact your host immediately. - Run the cron command manually to catch any immediate errors.
- Disable third-party extensions one by one to identify conflicts.
内容的提问来源于stack exchange,提问作者user8836893
相关产品推荐
相关产品推荐

