← Back to Baseline

Why it Matters

Magento relies heavily on scheduled tasks (cron jobs) for operations like sending emails, reindexing, cleaning logs, and processing orders. If crontab entries are missing, many background jobs will not run. This can break order processing, cause outdated indexes, and leave logs or sessions uncleared.

Ensuring that Magento cron jobs are properly configured and active keeps the store healthy, automated, and secure.

Verification Steps

Command line

# List cron jobs for the web user (e.g. www-data or magento)
crontab -u www-data -l

# Expected entries (example):
* * * * * php /var/www/magento/bin/magento cron:run | grep -v "Ran jobs" >> /var/www/magento/var/log/magento.cron.log 2>&1
* * * * * php /var/www/magento/update/cron.php >> /var/www/magento/var/log/update.cron.log 2>&1
* * * * * php /var/www/magento/bin/magento setup:cron:run >> /var/www/magento/var/log/setup.cron.log 2>&1

Remediation / Fix Guidance

  1. Add the standard Magento cron jobs to the system crontab for the Magento user.
  2. Ensure cron runs every minute, not just hourly or daily.
  3. Redirect output to log files for monitoring and troubleshooting.
  4. Verify that the correct PHP binary path is used (match production PHP version).
  5. Automate crontab setup in deployment scripts so it is consistent across servers.

Examples

Fail Example
# crontab -u www-data -l
(no crontab for www-data)
# Missing Magento cron jobs → FAIL
Pass Example
# crontab -u www-data -l
* * * * * php /var/www/magento/bin/magento cron:run ...
* * * * * php /var/www/magento/update/cron.php ...
* * * * * php /var/www/magento/bin/magento setup:cron:run ...
# Proper cron jobs in place → PASS

References