Download the PHP package chronon/pawsback without Composer
On this page you can find all versions of the php package chronon/pawsback. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pawsback
PawsBack
P
as in PHP since that's what it's written in.aws
as in Amazon Web Services S3 since that is where it backs things up to.Back
as in backup since that is what it does.
PawsBack
is a PHP CLI tool which allows you to configure multiple backup sources in a configuration file and sync them to S3. The AWS PHP SDK is used for bucket checking and creation, but not for uploading since it offers no intelligent syncing (everything is uploaded every time). PawsBack
generates commands for the aws cli tool which does have an intelligent sync mode, allowing you to upload only changed files and delete ones that no longer exist.
Requirements
- PHP - developed and tested with v7.0.x but should work on v5.6 as well (see test build with PHP v5.6.22 and PHPUnit v5.7.19). To install with PHP 5.6 change the
require
version incomposer.json
, and optionally set the PHPUnit version to^5.0
to run tests. - The aws cli tool, which requires Python. The bundled installer is very simple to install.
Installation
To install globally into ~/.composer/vendor/bin
:
You can then symlink ~/.composer/vendor/bin
to an existing directory in your PATH
(such as ~/bin
) or add the directory to your PATH
.
Configuration
A sample configuration file can be found at tests/test_app/test.json
and is similar to the one below.
provider:S3
- required
bucket
: the bucket to backup to - optional
region
: S3 region, default is"us-east-1"
- optional
profile
: aws cli tool profile, default is"default"
- optional
delete
: whether to delete S3 files if removed from source, default istrue
- optional
options
: any additional aws cli tool options to add globally, default is""
backups:sources
- required
name
: the directory on S3 that will be be created and store the data for this source - required
root
: an absolute path to the backup root directory - required
dirs
: and array of directories as key and backup optional options as values
The S3 command documentation has lots of useful examples explaining --exclude
, --include
, etc. An example is in the sample configuration file below, where in the prefixed
subdirectory only files that start with baz_
would be backed up.
PawsBack
sample configuration file:
Usage
The single entry point is bin/pawsback
, which can be run with the -h
options for help:
NOTES:
- The
-d
option for dry run will check and create a bucket if it doesn't exist as it's using the aws cli tool's dry run mode. To just see the commands that will run without checking/creating a bucket or verifying backup paths, use the-g
mode to generate a list of commands. - All options can be used together.
AWS CLI Configuration
Once installed the aws
cli tool can be configured by running aws configure
, or by creating the simple configuration files config
and credentials
in ~/.aws
. If multiple profiles are needed, configure the profiles in the aws
configuration (see named profiles) and use the named profile in your provider:S3:profile
configuration.
Tests
Tests (PHP Codesniffer and PHPUnit) can be run with bin/run-tests
. Code coverage is 100%, and any pull requests must include applicable tests.