PHPackages                             jdelaune/aws-ec2-snapshot-management - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jdelaune/aws-ec2-snapshot-management

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jdelaune/aws-ec2-snapshot-management
====================================

AWS EC2 Snapshot Manager for maintaining snapshots

v2.0.1(11y ago)12384MITPHPPHP &gt;=5.3.0

Since Feb 28Pushed 10y ago2 watchersCompare

[ Source](https://github.com/jdelaune/AWS-EC2-Snapshot-Management)[ Packagist](https://packagist.org/packages/jdelaune/aws-ec2-snapshot-management)[ Docs](https://github.com/jdelaune/AWS-EC2-Snapshot-Management)[ RSS](/packages/jdelaune-aws-ec2-snapshot-management/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

EC2 Snapshot Management
=======================

[](#ec2-snapshot-management)

- [Introduction](#introduction)
- [Installation](#installation)
- [Configuration](#configuration)
- [Example](#example)
- [Command Line Parameters](#command-line-parameters)

Introduction
------------

[](#introduction)

AWS EC2 Snapshot Management is a php script which prunes EC2 snapshots as if they were backups. It's meant to be run from the command line, but can be called by other PHP scripts if you so desire. As well as cleaning up snapshots it can also be used to take new snapshots as well.

The cleanup function will keep snapshots made:

- Daily: In the last seven days.
- Weekly: One per week in the last month.
- Monthly: One per month.

*It will always keep at least one snapshot even if it was made a year ago.*

This script took inspiration from 'EC2 Manage Snapshots' made by Erik Dasque and previously Oren Solomianik. It however requires the AWS PHP SDK.

This script is provided under the MIT License.

Installation
------------

[](#installation)

The recommended way to install EC2 Snapshot Management is through [Composer](https://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version of EC2 Snapshot Management:

```
composer require jdelaune/aws-ec2-snapshot-management
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

Configuration
-------------

[](#configuration)

EC2 Snapshot Management uses the AWS PHP SDK. You will needed to setup your credentials by following the instructions given here:

It expects a profile called `ec2snapshot`.

Example
-------

[](#example)

You will need to create a sample script like the one below:

```
