Write a script to automate the backup of a specific directory to an S3 bucket and send an alert on failure.