Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - Backup::fullbackup_to_ftp - Developer Documentation - cPanel Documentation
Child pages
  • UAPI Functions - Backup::fullbackup_to_ftp
Skip to end of metadata
Go to start of metadata


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 or Webmail Session URL


This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$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'			=> 'example.com',
		'port'			=> '21',
		'directory'		=> '/public_ftp',
		'email'			=> 'username@example.com',


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.
# 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'			=> 'example.com',
		'port'			=> '21',
		'directory'		=> '/public_ftp',
		'email'			=> 'username@example.com',


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

 Command Line
uapi --user=username Backup fullbackup_to_ftp variant=active username=username password=luggage123456 host=example.com directory=/public_ftp port=21 email=username@example.com


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


 Output (JSON)


Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.


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 address.example.com
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 address.username@example.com


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