Skip to content

craig-mcmahon/backup-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backup-lib

Modular backup library allowing easy creation of both backup and storage modules

Usage

<?php
$backup = new \BackupLib\Backup(__DIR__ . '/config.yml');

// Optionally set PSR standard logger
$backup->setLogger($logger);

// Start the backup
$backup->run();

Config

Example configuration file

settings:
  notification_emails:
    [email protected]: Name
    [email protected]
jobs:
  Job Name 1:
    module: MySQL
    config:
      method: mysqldump
      user: root
      pass:
      port: 3306
    storage:
      LocalFile:
        location: /tmp/backup
  Job Name 2:
    module: File
    config:
      dirs: /var/www
      exclude: cache
    storage:
      SSH2:
        server: 127.0.0.1
        user: backup
        password:
        key:
        location: /tmp/backup

Modules

File

Config Options

  • dirs
  • exclude

MySQL

Config Options

  • user: root
  • pass:
  • port: 3306
  • host: 127.0.0.1
  • filePerTable: true
  • excludedDatabases
  • includedDatabases

Storage

LocalFile

Config Options

  • location = /tmp

SSH2

Backup using the SSH2 extension to a remote SFTP server

Requires ext-ssh2

Config Options

  • hostname
  • user
  • pass
  • pubKey
  • privKey
  • remoteLocation
  • authType

Google Drive

Requires p13eater/google-helper

Config Options

  • clientId
  • clientSecret
  • accessTokenLocation
  • refreshTokenLocation

About

PHP Backup Library

Resources

Stars

Watchers

Forks