douglasjarquin / backuphp forked from ianneub/php_backup_s3

A PHP application that handles scheduled backups to S3

This URL has Read+Write access

Tue Jun 09 12:29:04 -0700 2009
commit  960f6698eb45ac17dd83553c7980378a46d3642a
tree    b478c2b9ef9a7e0ec705e02c37f9fd48c3fcf88d
parent  f24c65571b8532cf80e711405351d3263c449e57
README.markdown

Backuphp

A fork of the phpBackupS3 by Ian. This program will backup file paths and MySQL databases to Amazon's S3 cloud storage service.

Features

  • Easy to use
  • Backups MySQL database and files
  • Written in PHP (Yes, this is a feature)
  • Removes old backups according to a grandfather-father-son based schedule

Requirements

Installation

  1. Rename backup.php.example to backup.php.
  2. Edit the configuration settings in the backup.php.
  3. Upload all files to your server.
  4. Setup a cron job to run the backups for you!

For example, add a "backup" cron to your cron.daily:

#!/bin/sh

php -q /home/douglas/backuphp/backup.php
exit 0

About this script

This set of scripts ships with three files:

  • backup.php--This is an example of how to call the backup functions
  • functions.php--All the backup functions are in here
  • vendor/
    • s3.php--This is the library to access Amazon S3

Backup deletion schedule

A unique feature of this script is the way it will store (and eventually delete) old backups to conserve space, and yet maintain significant backup history. In this method you will have the following full backups:

  • Everyday for the past two weeks (14 backups)
  • Every saturday for the past 2 months (8 or 9 backups)
  • First day of the month going back forever

This allows you to keep a very detailed history of your files during the most recent time, but progressively remove backups as time goes on to save space. This feature can be turned off if you want to store all your backups, all the time.

To disable this feature, comment out the following line from functions.php:

deleteBackups($BACKUP_BUCKET);