1

To summarize my problem, I have a 'daily updates' kind of Python program that I want to be able to automate running once every day. The program produces a text file that I want to be automatically uploaded to GitHub every day.

I created and connected to an Amazon EC2 instance but I am not sure how to proceed, or whether this was the best way to solve this problem. Any help is much appreciated.

  • Take a look at https://stackoverflow.com/questions/30806318/how-to-cron-job-setup-in-amazon-ec2 – Naoyuki Tai Apr 26 '21 at 03:57
  • Why are you using an EC2 instance? Is that a requirement? A lambda seems like more suitable and cheaper for what you are looking for. Example from AWS Documentation https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html – Andreu Gallofré Apr 26 '21 at 09:24
  • @NaoyukiTai, how do you use cron to handle a txt file output produced by the program? Been searching for documentation on this but I can't find it. – thesmashten Apr 26 '21 at 21:14
  • Write a shell or python script as a wrapper. Run the "txt producing python" to a temp file. Use either python or curl and post it to Github. It is probably easier to drive a curl from Python using "subprocess". – Naoyuki Tai Apr 26 '21 at 21:31

0 Answers0