I'm just getting started with AWS and recently deployed my first Python script that scrapes data from a website and sends it via email. I set up a cron job to run this script every 2 minutes as part of my testing phase. It worked well for a few hours but then suddenly stopped functioning. Is there a way to diagnose what went wrong? I'm using EC2 instances for this.
3 Answers
How are you sending emails from your EC2 instance? Just a heads up, AWS blocks outbound traffic on port 25 for new accounts, so you might need to look into that.
Make sure to check both the cron job and your script logs. If your script isn't logging anything, you should update it to do so to help with troubleshooting.
Did you set up logging for your script? It could have crashed without notifying you.
But shouldn't it still function even if the script crashes? It’s running through a crontab, right? I checked, and the instance state shows 1/2 passed.