Back to Cron Helper
Recipephpmagentoecommercecms

Run Magento 2 Cron

Required cron job for Magento 2 e-commerce stores.

Magento 2 relies heavily on cron for indexing, emails, currency rate updates, and catalog price rules. This command processes the Magento task queue. It is critical for the proper functioning of any Magento 2 store.

Cron Schedule

Every Minute* * * * *
Runs every minute of every hour, every day.

Command to Run

Copy and paste this command into your crontab or automation script

cd /path/to/magento && bin/magento cron:run
This command will run according to the cron schedule above.

Implementation Examples

Here are code examples for implementing this cron job in different programming languages:
Unix/Linux Crontab
* * * * * /path/to/script.sh
Python (with schedule library)
schedule.every(1).minutes.do(job)
Node.js (with node-cron)
cron.schedule('* * * * *', () => {
  console.log('Running every minute');
});
Go (with robfig/cron)
c.AddFunc("* * * * *", func() { fmt.Println("Run every minute") })
GitHub Actions Workflow
- cron: "* * * * *"

Related Cron Recipes

Automate PostgreSQL Backups Daily

How to schedule a daily PostgreSQL database backup using cron.
databasepostgresbackup

Automate MySQL Backups Daily

Schedule a daily MySQL database dump using cron.
databasemysqlbackup

Automate MongoDB Backups Daily

How to schedule a daily MongoDB backup using cron.
databasemongodbbackup

Automate Redis RDB Snapshots

Schedule a Redis background save (snapshot) via cron.
databaserediscache

PostgreSQL Vacuum Analyze

Automate PostgreSQL database maintenance with VACUUM ANALYZE.
databasepostgresmaintenance

Sync Folder to AWS S3

Cron job to sync local files to an AWS S3 bucket.
awscloudbackup