FabricioG
FabricioG

Reputation: 3320

Aws Elastic Beanstalk not executing cron.yaml file

I currently have a file cron.yaml in the root of my project.

version: 3
cron:
 - name: "shopify"
   url: "/shopify"
   schedule: "0 * * * *"
 - name: "quickbooks"
   url: "/qb'"
   schedule: "0 * * * *"
 - name: "Shopify-Completed"
   url: "/shopify-completed"
   schedule: "0 * * * *"
 - name: "License-Orders"
   url: "/getLicenseOrders"
   schedule: "0 * * * *"
 - name: "Tee-Orders"
   url: "/getTeesOrders"
   schedule: "0 * * * *"
 - name: "Engraved-Orders"
   url: "/getEngravedOrders"
   schedule: "0 * * * *"
 - name: "Engraved-Mexico-Orders"
   url: "/getMexicoEngravedOrders"
   schedule: "0 * * * *"
 - name: "Shopify-All-Orders"
   url: "/pull-shopify-orders"
   schedule: "*/10 * * * *"

These are all verified routes in my project. For example when I manually go to example.com//pull-shopify-orders it executes. However when it's in cron it's not firing. Any idea why?

Upvotes: 1

Views: 572

Answers (1)

Marcin
Marcin

Reputation: 238199

cron.yaml is only supported for worker environments:

You can define periodic tasks in a file named cron.yaml in your source bundle to add jobs to your worker environment's queue automatically at a regular interval.

For web environment you have to setup cron "manually" using .ebextentions. This is demonstrated in the recent AWS blog post:

This involves creating cron-linux.config (example name) file with defined files and commands sections.

Upvotes: 1

Related Questions