I'm new to AWS and recently deployed my first Python script that gathers data from a web page and sends an email. I've set up a crontab to run this script every 2 minutes for testing purposes. It initially ran fine for a few hours, but then it suddenly stopped. How can I find out what went wrong? I'm using EC2 instances for this setup.
3 Answers
Check the cron and script logs to see if any errors were logged. If your script doesn't currently log activity, consider adding logging to help troubleshoot in the future.
Have you set up logging for your script? It's possible that the script crashed at some point, and logging would help you trace what happened.
Make sure you're aware that AWS blocks outbound traffic on port 25 by default. If you're trying to send emails from your EC2 instance and haven't hosted your own email server, that could be an issue.
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String