I have a python file in my EC2 which connects to S3 and deletes all versions of objects.
session = boto3.Session() s3 = session.resource(service_name='s3') bucket = s3.Bucket('mys3bucket-delete-me') bucket.object_versions.delete()
In my job.sh I call this python file
#!/bin/bash python s3delete.py
Make my file executable
chmod +x job.sh and execute
This works fine and deletes all objects of my s3 bucket.
Issue is when I call this
job.sh within crontab
sudo crontab -e every minutes and it doesn’t execute
*/1 * * * * /home/ec2-user/job.sh
Please guide me what’s wrong?