This function creates a full backup to the remote server via File Transfer Protocol (FTP).

 The system creates a file in the backup-MM.DD.YYYY_HH-mm-ss.tar.gz filename format.

In this filename format:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
  • ss represents the second.
  • username represent's the account's username.


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Perform a full backup of the account's files via FTP.
$fullbackup = $cpanel->uapi(
	'Backup', 'fullbackup_to_ftp',
		'variant'		=> 'active',
		'username'		=> 'username',
		'password'		=> 'luggage123456',
		'host'			=> '',
		'port'			=> '21',
		'directory'		=> '/public_ftp',
		'email'			=> '',

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
# Perform a full backup of an account's files via FTP.
my $Backup_fullbackup = $cpliveapi->uapi(
    'Backup', 'fullbackup_to_ftp',
		'variant'		=> 'active',
		'username'		=> 'username',
		'password'		=> 'luggage123456',
		'host'			=> '',
		'port'			=> '21',
		'directory'		=> '/public_ftp',
		'email'			=> '',

<!-- Perform a full backup of an account's files via FTP. -->
[%execute('Backup', 'fullbackup_to_ftp', 
{ 'variant' => 'active', 
'username' => 'username', 
'password' => 'luggage123456', 
'host' => '', 
'directory' => '/public_ftp', 
'port' => '21', 
'email' => '',} ) %]

uapi --user=username Backup fullbackup_to_ftp variant=active username=username password=luggage123456 directory=/public_ftp port=21



ParameterTypeDescriptionPossible valuesExample

Whether to use the active or passive FTP variant to connect to the remote server.

For more information about FTP variants, read our How to Enable FTP Passive Mode documentation.

This value defaults to active.

  • active — The FTP server responds to the connection attempt and returns a connection request from a different port to the FTP client.
  • passive — The FTP client initiates connection attempts.


The remote server account's username.

A valid remote server username.username


The remote server account's password.

A valid remote server password.luggage123456


The remote server's hostname or IP address.

A valid hostname or IP
directory string

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

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

A valid directory.

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

The port number to use during the transfer.
This value defaults to 21.

A valid port number.


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

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

This value defaults to undef.

A valid email


ReturnTypeDescriptionPossible valuesExample
pidstringThe backup's process identifier.A valid PID.2857