HW05: Cron, Bash, and AWSCLI due Sat 30 Sep 23:59

This assignment focuses on writing {\tt bash} scripts and sched...
...our backup script to run every night using cron

Automated, Off-Site Backup

Automating an off-site backup scheme is a critical component of protected data. To accomplish this for your MySQL installation follow these steps:
  1. Write a bash script that uses mysqldump to take a snapshot of the database. The saved snapshot should cycle names so that there is a one week rotation of log files. I'm envisioning you'll name the files by the day of the week (e.g., abilenebites.com-backup-Mon, etc.) To get the current day of the week you can call that date command from your bash script. You'll want this script to be able to run without having to enter a password. To accomplish this following the instructions at https://www.serverlab.ca/tutorials/linux/database-servers/how-to-create-a-credential-file-for-mysql/ beginning at the section “Encrypting Your Credentials”. (16 pts)
  2. Learn how to backup a file to Amazon's S3 storage using the command-line interface:


  3. Add the necessary commands to your backup script to move the backup file to S3 as part of the script. (6 pts)
  4. Use cron to schedule your script to run every night. (4 pts)

Upload your backup script to Canvas. This will require that you renamed your script to have a .txt extension (for upload purposes only) even though it will not have any extension when you create it.