0

I am working with AWS Elastic beanstalk and have my worker server running and loading job successfully. However I have a cron job that I am wanting to run at multiple hours of the same day but I am stuck just loading the last schedule I've looked through the docs on AWS but they dont seem to cover multiple cron times for the same task

Here is my cron.yaml

version: 1
cron:
  - name: "SetOverdueStatusJob"
    url: "/periodic_tasks"
    schedule: "0 * * * *"

  - name: "Statistics::ComputeDailyKpiJob"
    url: "/periodic_tasks"
    schedule: "* 18 * * *"

  - name: "ProductStatusCheckJob"
    url: "/periodic_tasks"
    schedule: "0 0 * * *"

  # Notify Slack with order count
  - name: "SlackNotifierJob"
    url: "/periodic_tasks"
    schedule: "0 1 * * *" #9
    schedule: "0 6 * * *" #2
    schedule: "0 10 * * *" #6


  # Notify Slack with order count
  - name: "LabelDueDateJob"
    url: "/periodic_tasks"
    schedule: "* 18 * * *"

  - name: "Margin::CalculateJob"
    url: "/periodic_tasks"
    schedule: "* 18 * * *"

With the following I am trying to run all three but it is only loading the last one

  # Notify Slack with order count
  - name: "SlackNotifierJob"
    url: "/periodic_tasks"
    schedule: "0 1 * * *" #9
    schedule: "0 6 * * *" #2
    schedule: "0 10 * * *" #6
0

You can schedule multiple cron tasks using one cron expression. You can use crontab.guru to experiment with cron expressions.

To answer your question, you can achieve what you want by this expression 0 1,6,10 * * *

Cheers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.