2017 © Pedro Peláez
 

library phpbu

PHP Backup utility.

image

phpbu/phpbu

PHP Backup utility.

  • Sunday, July 29, 2018
  • by phpbu
  • Repository
  • 44 Watchers
  • 858 Stars
  • 6,424 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 50 Forks
  • 17 Open issues
  • 83 Versions
  • 3 % Grown

The README.md

PHPBU

PHP Backup Utility, (*1)

PHPBU is a php tool that creates and encrypts backups, syncs your backups to other servers or cloud services and assists you monitor your backup creation., (*2)

Get an in depth look into all the features and a short 'getting started' tutorial at the PHPBU Website., (*3)

Latest Stable Version Minimum PHP Version Downloads License Build Status Scrutinizer Code Quality Code Coverage PHP Website, (*4)

If you are not using php 8.0 or greater already you can still use phpbu version 6.0.20 \ If you are not using php 7.2 or greater already you can still use phpbu version 5.2.10 \ If you are behind php 7.0 you can still use phpbu version 4.0.10, (*5)

Features

  • Creating backups
    • ArangoDB
    • Directories
    • Elasticsearch
    • InfluxDB
    • Ldap
    • MongoDB
    • MySQL
    • Percona XtraBackup
    • PostgreSQL
    • Redis
  • Compress backups
    • bzip2
    • gzip
    • xz
    • zip
  • Validate backups
    • Check min size
    • Comparing with previous backups
  • Encrypting backups
    • mcrypt
    • openssl
  • Sync backups to other locations
    • Amazon s3
    • Azure Blob
    • Dropbox
    • FTP
    • Google Drive
    • Google Cloud Storage
    • OpenStack
    • rsync
    • SFTP
    • Softlayer
    • Yandex Disk
  • Cleanup your local backup
    • Delete backups older x
    • Store only x MB of backups
    • Keep only last x backups
    • Keep less backups for more distant past
  • Writing backup reports
    • Text file
    • Json file
    • Mail
    • Prometheus
    • Telegram
    • Webhook

Requirements

  • PHP >= 7.2
    • ext/curl
    • ext/dom
    • ext/json
    • ext/spl
  • POSIX Shell
    • tar
    • bzip2 or gzip

Installation

You can download a PHP Archive (PHAR) that bundles everything you need to run PHPBU in a single file., (*6)

wget https://phar.phpbu.de/phpbu.phar
chmod +x phpbu.phar
php phpbu.phar --version

For convenience, you can move the PHAR to a directory that is in your PATH., (*7)

mv phpbu.phar /usr/local/bin/phpbu
phpbu --version

Using PHIVE to install PHPBU., (*8)

phive install phpbu

Installing PHPBU via Composer is also supported., (*9)

  "require": {
    "phpbu/phpbu": "^6.0"
  }

Usage

phpbu [option]

  --bootstrap=<file>       A "bootstrap" PHP file that is included before the backup.
  --configuration=<file>   A phpbu xml config file.
  --colors                 Use colors in output.
  --debug                  Display debugging information during backup generation.
  --generate-configuration Create a new configuration skeleton.
  --limit=<subset>         Limit backup execution to a subset.
  --simulate               Perform a trial run with no changes made.
  --restore                Print a restore guide.
  -h, --help               Print this usage information.
  -v, --verbose            Output more verbose information.
  -V, --version            Output version information and exit.

Usage Examples

$ phpbu

This requires a valid XML PHPBU configuration file (phpbu.xml or phpbu.xml.dist) in your current working directory. Alternatively, you can specify the path to your configuration file. An important thing to note is that all path inside the configuration should be absolute or relative to the configuration file itself., (*10)

$ phpbu --configuration=backup/config.xml

Use the --limit option to execute only a subset of your configured backups., (*11)

$ phpbu --limit=myAppDB

A dry run without any actual impact is executed with the --simulate option., (*12)

$ phpbu --simulate

To show a guide how to restore your backup use the --restore option., (*13)

$ phpbu --restore

Configuration Example

Simple configuration example in XML:, (*14)

  <?xml version="1.0" encoding="UTF-8"?>
  <phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/6.0/phpbu.xsd"
         verbose="true">
    <backups>
      <backup name="myAppDB">
        <!-- source -->
        <source type="mysqldump">
          <option name="databases" value="mydbname"/>
          <option name="user" value="user.name"/>
          <option name="password" value="topsecret"/>
        </source>
        <!-- where should the backup be stored -->
        <target dirname="backup/mysql"
                filename="mysqldump-%Y%m%d-%H%i.sql"
                compress="bzip2"/>
      </backup>
    </backups>
  </phpbu>

Simple configuration example in JSON:, (*15)

{
   "verbose":true,
   "backups":[
      {
         "name":"myAppDB",
         "source":{
            "type":"mysqldump",
            "options":{
               "databases":"mydbname",
               "user":"user.name",
               "password":"topsecret"
            }
         },
         "target":{
            "dirname":"backup",
            "filename":"mysql-%Y%m%d-%H%i.sql",
            "compress":"bzip2"
         }
      }
   ]
}

The Versions

28/09 2016

3.2.x-dev

3.2.9999999.9999999-dev http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

27/05 2016

3.1.x-dev

3.1.9999999.9999999-dev http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

07/02 2016

3.0.x-dev

3.0.9999999.9999999-dev http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

18/12 2015

2.1.15

2.1.15.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

14/12 2015

2.1.14

2.1.14.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

06/12 2015

2.1.13

2.1.13.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

05/12 2015

2.1.x-dev

2.1.9999999.9999999-dev http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

05/12 2015

2.1.12

2.1.12.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

25/11 2015

2.1.11

2.1.11.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

16/10 2015

2.1.10

2.1.10.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

07/09 2015

2.1.9

2.1.9.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

MIT

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

05/09 2015

2.1.8

2.1.8.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

03/09 2015

2.1.7

2.1.7.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

31/08 2015

2.1.6

2.1.6.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

21/06 2015

2.1.5

2.1.5.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

12/06 2015

2.1.4

2.1.4.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

30/05 2015

2.1.3

2.1.3.0 http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sebastian Feldmann

mongodb cloud mysql sftp backup tar rsync

19/05 2015
10/03 2015
08/02 2015
06/02 2015
27/01 2015
16/01 2015
28/11 2014

1.0.x-dev

1.0.9999999.9999999-dev http://phpbu.de/

PHP Backup utility.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Sebastian Feldmann

backup