2017 © Pedro Peláez
 

library backup-engine

A library used to backup project files and databases, and upload backups to dropbox.

image

dimsav/backup-engine

A library used to backup project files and databases, and upload backups to dropbox.

  • Saturday, January 10, 2015
  • by dimsav
  • Repository
  • 5 Watchers
  • 19 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 9 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Warning! This package is not maintained any more

Try this alternative instead: https://github.com/dimsav/backupish

Documentation

This is a library, written in php, used to backup your project's files and databases., (*1)

Installation

  1. Clone the repository
  2. Install the composer dependencies: composer install
  3. Create a file config/config.php according config/config.ini.php

Execution

Run php backup.php, (*2)

Features

  • Multiple projects can be backed up at once
  • Custom selection of backup directories per project
  • Custom selection of excluded paths
  • Password protection of backup files (.zip)
  • Detailed logs are saved to the server and are uploaded to dropbox.

Requirements

  1. This script can only be used in Unix systems (Linux/Mac), as we are using the zip command of the system.
  2. The function exec() should be available as we use it to zip our backups.
  3. The user executing the script must be able to write in the backups folder.
  4. The cURL extension is required if you want to use the dropbox uploader.

Instructions

  1. Copy config.ini.php to config.php.
  2. Edit config.php to define your projects to be backed up.
  3. Run cron.php using the command line or a web server.
  4. See the magic happen!

Defining your projects is a piece of cake:, (*3)

    /*
     * Define in this array the projects you wish to backup.
     *
     * The key of the array marks the name of the project
     * and it is used for folder and file names. So better
     * use alphanumeric characters with slash/underscores.
     */

    "projects" => array(

        /*
         * Here we define a project to be backed-up.
         * For this project, we want to backup only
         * the database. We use the default host and
         * port, and we override the username and password.
         *
         * For this project we are overriding the default
         * password with another one.
         */
        "project-1" => array(

            "database" => array(
                "name"    =>"db-name",
                "username"=>"db-user",
                "password"=>"db-pass",
            ),

            "password" => "another-secret",
        ),

        /*
         * For this project we backup both some files
         * and the database.
         *
         * We use the default database settings, so we
         * define only the database name.
         *
         * Under "paths" we put a list of absolute paths
         * of directories or files.
         *
         * Under "excludes" we put a list of absolute paths
         * of directories or files that should not be
         * included in the compressed backup files. The
         * contents of these directories will be skipped
         * recursively.
         */
        "project-2" => array(

            "database" => array(
                "name"=>"db-name",
            ),

            "paths" => array(
                "/absolute/project/folder/path",
                "/absolute/project/file/text.txt",
            ),

            "excludes" => array(
                "/absolute/project/folder/path/cache",
                "/absolute/project/folder/path/logs",
                "/absolute/project/folder/path/bigfile.tar",
            ),
        ),

        /*
         * Here we disable for project-3 the default password,
         * as we don't want any password for this project.
         */
        "project-3" => array(
            "paths" => array(
                "/project/folder",
            ),
            "password" => null,
        )

    ),

The Versions

10/01 2015

dev-master

9999999-dev http://github.com/dimsav/php-mysql-backup

A library used to backup project files and databases, and upload backups to dropbox.

  Sources   Download

MIT

The Requires

 

The Development Requires

php mysql backup dropbox

06/06 2014
06/05 2014