Once in a while I would go to http://aws.amazon.com/console and manually right click my EBS volume and create a snapshot.
This is kind of tedious and I would forget sometimes. Is it possible to automate this actions and say, make a daily or weekly snapshot?
I'm using a Windows Server instance.
Use AMI Tools:
As an alternative to command line tools you may use PHP script developed by me. It is easier to setup as you do not need write even a line of code and you do not need to setup environment.
Not only this script create snapshots automatically, it can also delete old snapshots after given period of time.
How to setup
Navigate to folder
Clon this gist into
ec2
folderGo to that folder
Make
backup.php
executableOpen releases of the AWS PHP SDK github project and copy URL of
aws.zip
button. Now download it into your server.Unzip this file into
aws
directory.Edit
backup.php
php file and set all settings in line5-12
. Pay attention on your region.Test it. Run this script
Check if snapshot is created.
If everything is ok just add cronjob. I run it everyday on 23:00. because i use interval
24 hours
. If you setup shorter interval, consider to trigger cronjob more often. You can even set it every 5 minutes. It will create new snapshot only with given interval anyway.