Create Custom Cron Job in Magento 2 Commerce Cloud

Adobe commerce cloud provides a feature to create a custom cron job by adding them to .magento.app.yaml file. You can execute any command by adding it to .magento.app.yaml file.

How to create a custom cron job in Adobe Commerce

You can set up any custom cron job by adding below to .magento.app.yaml file of the Magento commerce cloud project.

Syntax:

crons:
    cronrun:
        spec: "type_cron_time_here"
        cmd: "type_command_here"

Example:

crons:
    cronrun:
        spec: "* * * * *"
        cmd: "bin/magento indexer:reindex"

The above script runs an indexing command after every minute.

You can check and create the corn job syntax at https://crontab.guru/

Check your Adobe commerce project existing cron job using our blog How to get a cron job list in Magento commerce cloud