Reputation: 495
What would be the best way to run a python script on the first of every month?
My situation is I want some data sent to a HipChat room, using the python api, on the first of every month from AWS. The data I want sent is in a text file in a S3 bucket
Upvotes: 0
Views: 740
Reputation: 674
Create a Lambda function and use cloudWatch ==> Events ==> Rules and configure it
using: 1:AWS built in timers 2:Cron Expressions
In your case cron is better option
Upvotes: 0
Reputation: 200682
If your script can execute in under 5 minutes you could do this by creating a Python Lambda function and running it monthly via Lambda scheduled tasks. Running this once a month would stay well within the free Lambda usage limits, so your costs would be almost nothing.
If your script takes longer than 5 minutes to execute then you would probably need to schedule this as a cron job on an EC2 instance.
Upvotes: 2