LinuxCommandLibrary

phpbu

Backup PHP projects' databases and files

TLDR

Run backups using the default phpbu.xml configuration file

$ phpbu
copy

Run backups using a specific configuration file
$ phpbu --configuration=[path/to/configuration_file.xml]
copy

Only run the specified backups
$ phpbu --limit=[backup_task_name]
copy

Simulate the actions that would have been performed
$ phpbu --simulate
copy

SYNOPSIS

phpbu [options] command [command-options]

PARAMETERS

--config
    Specifies the configuration file to use (XML or YAML). Default is 'phpbu.xml' or 'phpbu.yml' in the current directory.

--quiet
    Suppresses non-error output.

--verbose
    Increases the verbosity of messages.

--debug
    Turns on debugging.

backup
    Initiates a backup process according to the configuration.

restore
    Restores a backup.

list
    Lists available backups.

help
    Displays help information.

version
    Displays the phpbu version.

DESCRIPTION

phpbu is a command-line utility written in PHP designed to create backups of databases and filesystems. It supports various database systems including MySQL, MariaDB, PostgreSQL, and SQLite. phpbu allows for configuration via a configuration file (XML or YAML) enabling automation and scheduled backups.

The utility can archive backups in various formats (e.g., zip, tar, gzip), encrypt them, and store them locally or remotely on services like Amazon S3, Dropbox, Google Cloud Storage, and others. phpbu provides flexibility for backup strategies, allowing you to customize which files and databases are included, how frequently backups are performed, and where they are stored. This makes it a comprehensive solution for managing backups in PHP-based projects, ensuring data safety and enabling easy restoration.

It offers features like pre- and post-backup scripts and integration with logging systems.

CAVEATS

phpbu requires PHP to be installed and available in the system's PATH. Database extensions (e.g., `pdo_mysql`, `pdo_pgsql`) need to be enabled in PHP to interact with the respective database systems. Remote storage functionality relies on appropriate drivers and credentials configured correctly in the configuration file.

CONFIGURATION FILE

The configuration file defines the databases, filesystems, and storage locations to be included in the backup. It allows you to specify credentials, encryption settings, and other options. phpbu supports both XML and YAML formats for the configuration file. See phpbu's documentation for more details and examples.

Copied to clipboard