Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to run a python script daily?

I have a python script that connects to Redshift, executes a series of SQL commands, and generates a new derived table.

But for the life of me, I can't figure out a way to have it automatically run every day.

I've tried AWS Data Pipeline but my shell script won't run the first copy statement. I can't get Lambda or Glue to work because my company's IAM policies are restrictive. Airflow seems like overkill to just run a single python script daily.

Any suggestions for services to look into?

like image 394
ScottieB Avatar asked Oct 26 '25 05:10

ScottieB


2 Answers

Cron job?

00 12 * * * /home/scottie/bin/my_python_script.py

Run my_python_script.py at the top of the hour (0th minute), at noon, every day.

like image 52
Jack Ryan Avatar answered Oct 28 '25 21:10

Jack Ryan


use a cron job on an ec2 instance or set up a scheduled event to invoke your aws python lambda function http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html

like image 40
Moe Avatar answered Oct 28 '25 22:10

Moe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!