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. The software requires PHP >= 7.2, but old version exists for older PHP, and released under an open source license. PHPBU could be easily integrated with Laravel framework via laravel-phpbu.

To use it simply create an xml config file like :

<?xml version="1.0" encoding="UTF-8"?>
<phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/5.0/phpbu.xsd">
  <backups>
    <backup name="MyDatabase">
      <!-- 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"/>
      <!-- check the created backup -->
      <check type="SizeMin" value="10M"/>
      <!-- cleanup the backup location -->
      <!-- as soon as all created backups exceed 500MB remove oldest backups -->
      <cleanup type="Capacity">
        <option name="size" value="500M"/>
      </cleanup>
    </backup>
  </backups>
</phpbu>

Then create a backup directory that holds all created backups and put the xml config file created in your working directory. Then run the phpbu.phar and you should get something like this :

phpbu 5.0.0 by Sebastian Feldmann and contributors
Configuration read from /var/www/acme/phpbu.xml.dist
Time: 44 ms, Memory: 1.00Mb
backup mysql: OK
          | executed | skipped | failed |
----------+----------+---------+--------+
 checks   |        1 |         |      0 |
 syncs    |        0 |       0 |      0 |
 cleanups |        1 |       0 |      0 |
----------+----------+---------+--------+
OK (1 backup, 1 check, 0 syncs, 1 cleanup)

Some of the PHPBU 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
    • 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

More information at https://phpbu.de/

LEAVE A REPLY

Please enter your comment!
Please enter your name here