Skip to content

deadlyhifi/phpMyS3backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

== What is phpMyS3backup? ==
phpMyS3backup is a PHP based tool that will backup a MySQL server to Amazon's
S3 service (http://aws.amazon.com/s3/). The tool requires php5-cli
and mysqldump, it also uses the AWS SDK for PHP (
https://github.com/amazonwebservices/aws-sdk-for-php ) which is included.

== How to use? ==
* Grab a copy of the latest code: git://github.com/deadlyhifi/phpMyS3backup.git
* Fill in your connection credentials in phpMyS3backup.php
* Execute `php phpMyS3backup.php` and wait
* When you get dropped back to the command line, check your S3
* Done!

* Set it running with a cron job and rest easy as your databases are backed up while you sit with your feet up sipping coffee.
* If you want backups to auto delete after a given time period then visit your S3 management console
	* https://console.aws.amazon.com/s3/home
	* Enter your backup bucket
	* Click 'Properties'
	* Click 'Lifecycle'
	* Enter a name (e.g. `mysql backup expiration`)
	* Under prefix enter 'mysql_backups' (or whatever you have set BACKUP_FOLDER to)
	* Enter expiration time (e.g. 30 days) 

=== Further Information on Object Expiry ===
http://docs.amazonwebservices.com/AmazonS3/latest/dev/ObjectExpiration.html
http://docs.amazonwebservices.com/AmazonS3/latest/UG/ObjectExpiration.html

== How it works? ==
Here's the short version of what this tool does:
* Get's a list of all your databases (except `information_schema`)
* mysqldump each database to it's own file
* gzip's each dump file
* Upload all files to your defined S3 bucket
** All files are stored with:
*** Reduced Redundancy Storage
*** AES256 Encryption
*** "Private" permissions (no sharing)
* Delete the local backups

== License ==
=== phpMyS3Backup - MIT License ===
Copyright (c) 2012 Jon Davis

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

=== AWS SDK for PHP ===
The AWS SDK for PHP is copyright Amazon and licensed under the Apache 2.0
license ( http://aws.amazon.com/apache2.0/ ).

About

A small tool that will backup MySQL databases into Amazon S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%