HardlyNoticeable February 2016

Running CRON jobs on Amazon ec2

Another answer posted here said that running cron jobs on ec2 (Linux) is the same as on any 'nix server. But I'm confused: how does one manage cron jobs where there are multiple instances of an application server? I would have thought there's be some kind of shared cron... like Reddis for cron jobs.

What does one do to make sure only one instance is running cron jobs?

Answers


Srujan February 2016

I use 'rcron' for this. This helps managing cron jobs in a cluster of instances. An instance will execute a job only if it's active. It relies on heartbeat or keepalived to check whether other instances are active or not. It's important to go through principles section of rcron, as it doesn't do a lot of things which might be necessary. (like failure of a job on one instance doesn't automatically start it on any other instance.)

And yes, it's same for any group of linux machines and not only ec2 instances.

Post Status

Asked in February 2016
Viewed 2,360 times
Voted 8
Answered 1 times

Search




Leave an answer