Q:

Multiple crons in AWS Elastic Beanstalk

I currently am executing a cron like so.
I have a file in .ebextensions/cron-linux.config
In that file I have:
files:
    "/etc/cron.d/mycron":
        mode: "000644"
        owner: root
        group: root
        content: |
            */5 * * * * root /usr/local/bin/myscript.sh

    "/usr/local/bin/myscript.sh":
        mode: "000755"
        owner: root
        group: root
        content: |
            #!/bin/bash

            date > /tmp/date
            /usr/bin/wget -O /dev/null https://example.com/pull-shopify-orders
            /usr/bin/wget -O /dev/null https://example.com/getMexicoEngravedOrders
            exit 0

commands:
    remove_old_cron:
        command: "rm -f /etc/cron.d/mycron.bak"

I need to run different crons at different times.  How would I go about doing this?
Would I add another cron-linux.config file like: cron2-linux.config?
The aws documentation isn't clear on this.

A:

You can just create new cron file (e.g. mycron2) and new script (myscript2.sh with new content). For example, the following should work:
files:
    "/etc/cron.d/mycron":
        mode: "000644"
        owner: root
        group: root
        content: |
            */5 * * * * root /usr/local/bin/myscript.sh

    "/etc/cron.d/mycron2":
        mode: "000644"
        owner: root
        group: root
        content: |
            */10 * * * * root /usr/local/bin/myscript2.sh

    "/usr/local/bin/myscript.sh":
        mode: "000755"
        owner: root
        group: root
        content: |
            #!/bin/bash

            date > /tmp/date
            /usr/bin/wget -O /dev/null https://example.com/pull-shopify-orders
            /usr/bin/wget -O /dev/null https://example.com/getMexicoEngravedOrders
            exit 0

    "/usr/local/bin/myscript2.sh":
        mode: "000755"
        owner: root
        group: root
        content: |
            #!/bin/bash

            date > /tmp/date2
            /usr/bin/wget -O /dev/null https://example.com/pull-shopify-orders
            /usr/bin/wget -O /dev/null https://example.com/getMexicoEngravedOrders
            exit 0

commands:
    remove_old_cron:
        command: "rm -f /etc/cron.d/mycron.bak"

