PHPackages                             tuscanicz/php-aws-snapshots - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. tuscanicz/php-aws-snapshots

ActiveLibrary[File &amp; Storage](/categories/file-storage)

tuscanicz/php-aws-snapshots
===========================

A simple library that manages AWS backups from PHP.

1.1.1(9y ago)019.7kMITPHPPHP &gt;=5.5.0

Since Jul 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tuscanicz/php-aws-snapshots)[ Packagist](https://packagist.org/packages/tuscanicz/php-aws-snapshots)[ Docs](https://github.com/tuscanicz/php-aws-snapshots)[ RSS](/packages/tuscanicz-php-aws-snapshots/feed)WikiDiscussions master Synced 4w ago

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

Create automatic AWS EC2 snapshots with limits on the total number of snapshots created and the interval which the snapshots are created.

For example, you could create a snapshot every day and only keep the last 7 for a running week's worth of snapshots. Or create a snapshot once a week and only keep the last 4 so you would have a running month's worth of snapshots.

Requirements
------------

[](#requirements)

- [AWS CLI](http://aws.amazon.com/cli/)
- AWS IAM snapshot permissions ([example policy](#example-iam-policy))
- PHP 5.5+
- Access to crontab (or some other job scheduler)

AWS CLI installation
--------------------

[](#aws-cli-installation)

```
sudo apt-get install python-pip php5-cli
sudo pip install awscli

// set credentials (Access Key ID, Secret Access Key) and region - ie: us-east-1, us-west-1
aws configure

```

Setup
-----

[](#setup)

This assumes you've already installed and configured [AWS CLI](http://aws.amazon.com/cli/) and added the correct [IAM permissions](#example-iam-policy) within your AWS console.

### 1. Create a PHP script to use the library

[](#1-create-a-php-script-to-use-the-library)

Use [composer](https://getcomposer.org) to autoload all the necessary classes.

Setup AWS CLI installation directory (using the value from `which aws`) and [configure your volumes](#volume-configuration).

Finally wire the services and test run your cli task. You can also change a description prefix that is used by this library to pick snapshots from the server. This is done via the second argument of `Snapshots::run()`

```
