Skip to content

douglasjarquin/backuphp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

A PHP application that handles scheduled backups to S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%