amazon-web-servicescron

cron jobs on Amazon aws


I am currently using Amazon's Elastic Beanstalk as my web server. I need to be able to run some cron jobs every minute (so launching machines and shutting them down is not an option).

The solutions I have found for now are:

  1. run an ec2 machine and run those crons over there
  2. use aws ops that is bit complicated to setup + will eventually run an ec2 machine anyways.

Both of those solutions seems like an overkill. Is there any better solution out there? the perfect solution would be a "Platform as a service" (PaaS) one.


Solution

  • well, few years after. here are some new options to deal with this issue:

    1. as Adam said, there is an option to set a recurring event in elastic beanstalks' configuration named "container commands". the behavior is as the following code: container_commands: name of container_command: command: "command to run" leader_only: true name of container_command: command: "command to run" reference: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-container-commands
    2. Second option is using the Lambda functions with schedule events - http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html

    hope this will help anyone that bumps into this issue