Support

Documentation Akeeba Backup – User's Guide

Chapter 2. Using Remote CLI

Table of Contents

Usage
Options
Walkthrough

Usage

You can use Remote CLI from the command line of your operating system with a command like this:

php remote.phar --action=actionName --host=hostName --secret=secretKey [options]

Remote CLI requires a command line version of PHP (a.k.a. PHP-CLI) to be installed on your machine. In the command line above, please substitute php with the full path to your PHP CLI executable file. On most Linux and Mac OS X systems, you don't need to specify a path, just php will do as the executable file is already in the path. On Windows, however, you most likely need to specify a full path.

[Tip]Tip

The PHP project provides an installer of PHP for Windows which can install PHP for you and place the php.exe binary in your path. For sanity's sake, we recommend you to install PHP in c:\PHP and put remote.phar in there as well. This is the easiest way to be perfectly sure where everything is installed!

[Important]Important

Remote CLI requires PHP 5.3 or PHP 5.2 with the optional "phar" extension installed and activated. If you get a fatal error regarding the Phar class when you try to run Remote CLI, you are running PHP 5.2 without the "phar" extension activated. The easiest workaround is to install PHP 5.3 which has that extension built in. In any case, PHP 5.2 is end of life, so using PHP 5.3 is a more sane choice anyway.

hostName is the URL to your site's root, without a trailing slash, e.g. http://www.example.com. secretKey is the Secret Key you have defined in your Akeeba Backup "Component Configuration" dialog. The options which are required for each action are described in the Options chapter of this documentation. For practical examples, or if you want to find out how to automate backing up and downloading the backups of your site, please consult the Walkthrough chapter.

actionName can be one of:

test

Tests whether Remote CLI can connect to your site. If it can not, it will tell you why.

backup

Performs a backup. It can (optionally) download the backup archive and delete it from the server afterwards.

download

Downloads a backup archive and can optionally delete it from the server afterwards

deletefile

Delete backup archives from the server

delete

Deletes backup archives and the associated backup record from the server

listbackups

Lists the latest backup records

profiles

Lists the profile IDs and descriptions

backupinfo

Shows detailed information about a backup record

upgrade

Upgrades Akeeba Backup on the server, if there is an update available

[Warning]Warning

Before you can use Remote CLI with your site, you will need to enable the remote API in Akeeba Backup. In order to do that, go to your site's back-end, click on Components, Akeeba Backup and click on the Component Parameters button. You will have to set Enable front-end and remote backup to Yes. You will also need to supply a Secret Key of your liking. This is the password to connect to your site over Akeeba Backup's Remote API. Due to several issues which have to do with server configuration, we strongly recommend using only alphanumeric characters (a-z, A-Z, 0-9), dash and underscore in your Secret Key. Other characters may lead to inability to connect to your site.

Still need support?

Login or Subscribe to submit a new ticket.

(If filing a bug or you have a pre-sales request, please contact us directly.)