I have a periodic task that I need to run on EC2. It will not take more than 10 minutes to complete this task, and I donβt want to pay this task for 50 minutes for downtime. From my point of view, if I run an instance and run this task, regardless of whether I use any resources or not, I will be billed for my use. So I was looking to do something on the following lines every 60 minutes or so (just a high-level sketch):
def invokeTimer(i): if timer(i) expired: copyDataFromNode(i) killNode(i) while True: for i in range(1,10): startNode(i)
Assuming I was able to convey my idea, is there a good way to implement this in a clean way, or perhaps a tutorial that can help?
source share