Child pages
  • UAPI Functions - Backup::fullbackup_to_homedir
Skip to end of metadata
Go to start of metadata

Description

This function creates a full backup to the user's home directory. The system creates a file in the backup-MM.DD.YYYY_HH-mm-ss_username.tar.gz filename format.

Note:

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.


Example


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Backup/fullbackup_to_homedir


Note:

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.

// Performs a full backup of the account's files to your home directory.
$fullbackup = $cpanel->uapi(
	'Backup', 'fullbackup_to_homedir'
);


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.
 
# Performs a full backup of the account's files to your account's home directory.
my $Backup_fullbackup = $cpliveapi->uapi(
    'Backup', 'fullbackup_to_homedir'
);


Note:

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

 cPanel Template Toolkit
<!-- Performs a full backup of the account's files to your account's home directory. -->
[% data = execute( 'Backup', 'fullbackup_to_homedir' ); %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username Backup fullbackup_to_homedir


Notes:

  • 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:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "apiversion":3,
   "module":"Backup",
   "func":"fullbackup_to_homedir",
   "result":{
      "warnings":null,
      "errors":null,
      "metadata":{
      },
      "status":1,
      "data":{
         "pid":"2857"
      },
      "messages":null
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
emailstring

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

Note:

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


Returns

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