Skip to content

journeygroup/backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup

Why

Journey/Backup is a lightweight MySQL backup script written in PHP, and ideal for cron jobs. Its task is simple:

  • Dump a user-selected list, or all databases on the local MySQL server
  • Store those databases in a mounted directory, or on Amazon S3

Usage

Installation

The easiest way is to install via composer:

composer create-project journey/backup your-directory-name

Configuration

To configure, edit the config.php file with your own details. Here's is the sample configuration file, with helpful comments:

<?php

return [
    // Local database connection details
    'connection' => [
        'host' => "127.0.0.1",
        'username' => "mysql-username",
        'password' => "mysql-password",
    ],

    // String of databases to back up, empty value will backup all databases
    'databases' => [],

    // Location of the storage, can be absolute directory or s3 stream (s3://bucket-name)
    'storage' => 's3://your-s3-bucket',

    // List of AWS Connection credentials
    'aws' => [
        'key' => 'your-aws-key',
        'secret' => 'your-aws-secret'
    ],

    // Temporary location for dump
    'temp' => '/tmp'
];

Note: The host parameter is used only when databases is set to auto-discover all databases (empty array), otherwise all calls to MySQL are performed via shell operation.

Schedule

Scheduling your backups is as simple as setting up a cron job to execute the boot.php file.

About

Lightweight MySQL backup script ideal for cron jobs, written in PHP.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages