Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

EBS Snapshot scripts for php. Will create a snapshot and delete old ones.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README
Octocat-spinner-32 ebs-snapshot.php
Octocat-spinner-32 example.php
README
I uploaded an example file of how the php class is implemented. This can be added to cron to make backing up the database simple.

### Understanding the Constructor ###
public function __construct($ec2ToolsPath, $cert, $key, $snapDescription, $dbHost, $dbName, $dbUser, $dbPass, $volume, $snapToKeep)

$ec2ToolsPath - This is the path to the tools so that we can run the correct command.

$cert - This is the Amazon cert you get from your Amazon account.

$key - The matching key obtained from your Amazon account.

$snapDescription - The description of your snapshot. It need to be 'something_' . date("Y-m-d"). THIS IS VERY IMPORTANT. If you look at the sorting I explode the array of snapshots by the _ (underscore). And I use date to sort them.

$dbHost - The host of the database. Make sure your security groups are opened correctly. 

$dbName - Name of the database to connect to.

$dbUser - Database user who has permissions to connect.

$dbPass - Password for $dbUser

$volume - The volume to snapshot

$snapToKeep - The number of snapshots to keep.
Something went wrong with that request. Please try again.