https://github.com/hongster/aws-ec2-backup
I manage a number of EC2 instances on Amazon. I perform backup by creating snapshots of EBS volumes, as recovery is simple as creating EC2 instance from snapshot. My backup (PHP) script is published on Github.
How It Works
- Define a list of volumes in configuration file.
- A new snapshot is created for each volume, if there is no recently created snapshot within last 24 hours.
- Snapshots olders than 7 days (configurable) are deleted.
- Log is sent to an email recipient.
I scheduled a cronjob to run it once a day.
It Uses
- AWS SDK for PHP
- Custom logger that captues
echo
outputs and PHP error messages, then email it