Created
October 26, 2012 03:10
-
-
Save bradymholt/3956653 to your computer and use it in GitHub Desktop.
ec2-create-rolling-snapshot wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Stop mysql to ensure snapshot consistancy | |
echo "Stopping mysql..." | |
/sbin/service mysqld stop | |
echo "Creating snapshot..." | |
export AWS_ACCESS_KEY="AKIDDDDDDDDDDDD" | |
export AWS_SECRET_KEY="GQYL9/JKCFNbZ/2/DDDDDDDDDDDDDDDD" | |
export EC2_HOME=/opt/aws/apitools/ec2 | |
export JAVA_HOME=/usr/lib/jvm/jre | |
~/ec2-create-rolling-snapshot -d "Daily backup-vol-fac00d0d" vol-fac00d0d 7 | |
echo "Waiting for snapshot to finish building..." | |
sleep 10 | |
echo "Starting mysql..." | |
/sbin/service mysqld start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment