Skip to content

jojo080889/ebs-manage-snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ebs-manage-snapshot

A small script to help automatically make AWS EBS snapshots. This script can also delete snapshots older than a certain number of days. Based on this script and this StackOverflow question.

Setup

  • Install ec2-consistent-snapshot and gawk (sudo apt-get install gawk).
  • Create the AWSSnapshot folder in your home directory and place snapshot.sh and older_than_x_days.awk inside.
  • Open snapshot.sh in a text editor and fill in your AWS credentials where indicated. There are places to fill in this information near the top of the file where environment variables are listed, and on the line that says 'ec2-consistent-snapshot'. You'll have to visit your AWS security credentials page to download your Access Keys and X.509 Certificates.
  • On the line that says 'ec2-consistent-snapshot', make sure to fill in your MySQL credentials.
  • On the line that says 'ec2-describe-snapshots', make sure to change the 'days' parameter to indicate how old of snapshots you want to keep.
  • Save snapshot.sh, and use chmod to make it executable.
  • Create a cronjob to run snapshot.sh however often you like.

About

A small script to make and delete AWS EBS snapshots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published