Child pages
  • cPanel API 1 Functions - Fileman::fullbackup
Skip to end of metadata
Go to start of metadata

Description

This function creates a full backup.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Important:

In cPanel & WHM version 76 and later, when you disable the FileStorage role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/json-api/cpanel?arg-0=ftp&arg-1=example.com&arg-2=username&arg-3=12345luggage&arg-4=user%40example.com&arg-5=21&arg-6=%2Fpublic_ftp&arg-7=examplesshkey&arg-8-123456luggage&cpanel_jsonapi_user=username&cpanel_jsonapi_apiversion=1&cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=fullbackup

Warning:

We do not support this method. We strongly recommend that you use the command line example below instead.

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$create_backup = $cpanel->api1('Fileman', 'fullbackup', array('ftp', 'example.com', 'username', '12345luggage', 'user@example.com', '21', 'public_ftp', 'sshkey_name', 'examplesshkey', 'sshkey_passphrase', '123456luggage')); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $create_backup = $cpliveapi->api1('Fileman', 'fullbackup' ['ftp', 'example.com', 'username', '12345luggage', 'user@example.com', '21', 'public_ftp', 'sshkey_name', 'examplesshkey', 'sshkey_passphrase', '123456luggage']); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Fileman::fullbakup ( $FORM('dest','server','user','pass','email','port','rdir','sshkey_name','sshkey_passphrase'))">

 Command Line
cpapi1 --user=username Fileman fullbackup ftp example.com username 12345luggage user%40example.com 21 %2Fpublic_ftp examplesshkey 123456luggage


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (none)

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
deststring

The backup's transfer protocol or destination.

This value defaults to homedir.

  • scp
  • ftp
  • passiveftp
  • homedir
ftp
serverstring

The backup's destination.

Important:

This parameter is required if you specify scp, ftp, or passiveftp for the dest parameter.

A valid hostname or IP address.example.com
userstring

The username for the remote server.

Important:

This parameter is required if you specify scp, ftp, or passiveftp for the dest parameter.

A valid cPanel account's username.username
passstring

The password for the remote server.

Important:

This parameter is required if you specify scp, ftp, or passiveftp for the dest parameter.
The remote server's password.12345luggage
emailstring

The email address to receive a confirmation email when the backup completes.

Note:

The system does not provide confirmation if you do not pass this parameter.

This value defaults to undef.

A valid email address.user@example.com
portinteger

The port to use during the transfer.

Notes:

  • When you pass ftp or passiveftp for the dest parameter, this value defaults to 21.
  • When you pass scp for the dest parameter, this value defaults to 22.
  • When you pass homedir for the dest parameter, the system ignores this parameter.

This value defaults to an undefined value.

  • 21 — The port for ftp and passiveftp transfers.
  • 22 — The port for scp transfers.
 21
rdir string

The directory on the remote machine that will store the backup.

This value defaults to the remote server account's default login directory.

A valid directory name.

Important:

Enter the directory relative to the FTP user's login directory. For example, enter /public_ftp not /home/username/ public_ftp.

/public_ftp
sshkey_namestring

The UAPI SSL::generate_key function or cPanel API 2 SSH::importkey function's SSH key's name value.

Notes:

This value defaults to an undefined value.

A valid string.
examplesshkey
sshkey_passphrasestring

The SSH key's passphrase.

This value defaults to an undefined value.

A secure string of four characters or more.123456luggage

Returns

This function only returns metadata.