Skip to content

Instantly share code, notes, and snippets.

@benpearson2003
Last active December 2, 2018 22:15
Show Gist options
  • Save benpearson2003/f4739f91a52643b07b54 to your computer and use it in GitHub Desktop.
Save benpearson2003/f4739f91a52643b07b54 to your computer and use it in GitHub Desktop.
Setting Up Automated Snapshots
Install AWS CLI if missing.
http://docs.aws.amazon.com/cli/latest/userguide/installing.html
Configure AWS CLI
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
>> Roadblock: Missing keys: Ask [designated AWS admin] to give you keys.
>> Error: Region: Confirm your server's region.
Install EC2 API Tools if missing
https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html
>> Roadblock: Permission denied: Ask [designated AWS admin] to fix it.
>> Error: Required option '-K, --private-key KEY' missing:
git clone https://github.com/colinbjohnson/aws-missing-tools.git
>> Roadblock: Not using git-enabled user: sudo su - magento (or whatever git-enabled user, just make sure to replace "magento" every time it's used later)
Setup Cron Primer
sudo cp /home/magento/aws-missing-tools/ec2-automate-backup/Resources/cron-primer.sh /home/magento/aws-missing-tools/ec2-automate-backup/Resources/cron-primer-local.sh
sudo nano /home/magento/aws-missing-tools/ec2-automate-backup/Resources/cron-primer-local.sh
Fill in all the information
Setup Cron
sudo EDITOR=nano crontab -e (vi is complicated, OK?)
# Use the automated backup script that comes with aws-missing-tools. Snapshots are purged 7 days after creation.
0 0 * * * /home/magento/aws-missing-tools/ec2-automate-backup/ec2-automate-backup.sh -p -k 7 -c "/home/magento/aws-missing-tools/ec2-automate-backup/Resources/cron-primer-local.sh" -v "vol-#######"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment