Chapter 4. The Command-Line-Runner

If you have a configuration file named phpbu.xml in your current working directory you can execute PHPBU like this

~$ phpbu
phpbu 6.0.0 by Sebastian Feldmann and Contributors.

OK (1 backup, 0 checks, 0 encryption, 0 syncs, 0 cleanups)

If you want to use a custom name for your configuration file you have to use the --configuration option.

~$ phpbu --configuration=MyConfig.xml
phpbu 6.0.0 by Sebastian Feldmann and Contributors.

OK (1 backup, 0 checks, 0 encryption, 0 syncs, 0 cleanups)

Command-Line-Runner options

Here is the list of available options for the command line runner.

$ phpbu --help
phpbu 6.0.0 by Sebastian Feldmann and Contributors.

Usage: phpbu [option]

--bootstrap=<file>       A "bootstrap" PHP file that is included before the backup.
--configuration=<file>   A PHPBU configuration 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 simulation run with no changes made.
-h, --help               Print this usage information.
-v, --verbose            Output more verbose information.
-V, --version            Output version information and exit.
--version-check          Check whether PHPBU is up to date.
--self-update            Upgrade PHPBU to the latest version.
--bootstrap

A "bootstrap" PHP file that is included before executing the backup.

--configuration

Path to the phpbu config file to use. See Chapter 2 for more details.

--colors

Use colors in output.

--debug

Display debugging information during backup generation.

--limit

Limit backup execution to a subset. See the limit section for details.

--restore

Output a guide how to restore your backup. For this to work all your Sources and Crypts have to implement the Restorable interface

--simulate

Execute PHPBU without actually executing any backup, check, encryption, sync or cleanup task. See the simulation section for details.

Simulation

In order to check what actions PHPBU would perform, PHPBU supports a simulation mode where no backup is actually created and no sync and cleanup tasks are executed. In simulation mode, PHPBU will show you, what it would have done, if it would not have been a simulation run. You will get detailed output, which enables you to track every action PHPBU would have performed.

This is a great way to test if the correct backup commands will be executed and if all the right backups will be cleaned up.

Warning

If PHPBU has to use any kind of credentials executing a binary, like for example the mysqldump command, these credentials will be displayed in the simulation output.

If you are extending PHPBU, you can support simulation as well. You can find detailed information on this in Chapter 11.

Limit

If you don't want to execute all of your configured backups you can define a subset of backups by using the limit option.

All you have to to, is to set the limit option to a comma separated list of backup names (nameA,nameB,nameC).

Warning

If you don't define explicit backup names, PHPBU will use the source type as backup name as fallback.

Please open a ticket on GitHub to suggest improvements to this page. Thanks!