You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

Child pages
  • WHM API 1 Functions - start_background_pkgacct
Skip to end of metadata
Go to start of metadata

Description

This function backs up an account with the pkgacct script.

Note:

  • The /usr/local/cpanel/scripts/pkgacct script logs results to the /var/cpanel/pkgacct_sessions/session_id/ directory, where session_id represents the backup session's ID.
  • The target system streams the output of this function with the /usr/local/cpanel/whostmgr/docroot/cgi/live_tail_log.cgi script on the source system. Users should not directly call this script.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/start_background_pkgacct?api.version=1&user=username&skiphomedir=1&skipbwdata=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/start_background_pkgacct?api.version=1&user=username&skiphomedir=1&skipbwdata=1
 Command Line
whmapi1 start_background_pkgacct user=username skiphomedir=1 skipbwdata=1


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "session_id":"example201511191557484NIG7QJ8FYX4kIk",
      "complete_master_error_log":"master.error_log",
      "complete_master_log":"master.log"
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"start_background_pkgacct"
   }
}
 Output (XML)
<result>
    <data>
        <session_id>example201511191557484NIG7QJ8FYX4kIk</session_id>
        <complete_master_log>master.log</complete_master_log>
        <complete_master_error_log>master.error_log</complete_master_error_log>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>start_background_pkgacct</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample

user

string

Required

The cPanel account to back up.

A valid cPanel account name.

username
compressionsetting string

Whether to compress the data in .gzip format.

This parameter defaults to null.

  • compress — Compress the data.
  • null — Do not compress the data.
compress
incrementalBoolean

Whether to update the destination file with any new content since the previous backup. This parameter also removes any content that no longer exists on the account. If the destination file does not exist, the function creates a new file in that location.

Note:

  • When you use this parameter, the system creates the backup as an uncompressed archive.
  • We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Create an incremental archive file.
  • 0 — Do not create an incremental archive file.
1
low_priority Boolean

Whether to run the background task with a reduced priority.

This parameter defaults to 0.

  • 1 — Run the backup as a low priority task.
  • 0 — Run the backup with normal priority.
1
mysqlver string

The minimum version of MySQL® that the system requires to restore the backed up database files.

Note:

You can view the server's installed version of MySQL in the /var/cpanel/cpanel.config file.

This parameter defaults to the current installed version of MySQL.

A valid version of MySQL that is available on the server.5.5
serialized_output Boolean

Whether to encode each line of the script's output in JSON format in order to allow the live_tail_log.cgi script to stream it.

This parameter defaults to 0.

  • 1 — Send serialized output.
  • 0 — Do not send serialized output.
1
skipacctdb Boolean

Whether to exclude the account's databases from the cpmove archive.

This parameter defaults to 0.

  • 1 — Do not back up the account's databases.
  • 0 — Back up the account's databases.
1
skipapitokensBoolean

Whether to exclude the account's API tokens from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's API tokens.
  • 0 — Back up the account's API tokens.
1
skipauthnlinksBoolean

Whether to exclude the account's external authentication credentials from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's external authentication credentials.
  • 0 — Back up the account's external authentication credentials.
1
skipbwdata Boolean

Whether to exclude the account's bandwidth data from the archive.

This parameter defaults to 0.

  • 1 —Do not back up the account's bandwidth data.
  • 0 — Back up the account's data.
1
skipdnssecBoolean

Whether to exclude the account's DNSSEC configuration from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's DNSSEC configuration.
  • 0 — Back up the account's DNSSEC configuration.
1
skipdnszonesBoolean

Whether to exclude the account's DNS zone file information from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's DNS zone file information.
  • 0 — Back up the account's DNS zone file information.
1
skipftpusersBoolean

Whether to exclude the account's FTP user accounts from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's FTP user accounts.
  • 0 — Back up the account's FTP user accounts.
1
skiphomedirBoolean

Whether to skip the home directory's contents.

This parameter defaults to 0.

  • 1 — Do not back up the account's home directory.
  • 0 — Back up the account's home directory.









1
skiplinkednodesBoolean

Whether to exclude the account's cPanel & WHM linked server nodes configuration from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's linked server nodes configuration.
  • 0 — Back up the account's linked server nodes configuration.
1
skiplogsBoolean

Whether to exclude the account's log files from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's log files.
  • 0 — Back up the account's log files.
1
skipresellerconfigBoolean

Whether to exclude the account's reseller privileges from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's reseller privileges.
  • 0 — Back up the account's reseller privileges.
1
skipshellBoolean

Whether to exclude the account's shell information and privileges from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's shell information and privileges.
  • 0 — Back up the account's shell information and privileges.
1
skipvhosttemplatesBoolean

Whether to exclude the account's virtual host (vhost) templates from the archive.

Note:

We added this parameter in cPanel & WHM version 88.

This parameter defaults to 0.

  • 1 — Do not back up the account's vhost templates.
  • 0 — Back up the account's vhost templates.
1
split Boolean

Whether to create the cpmove archive in chunks.

This parameter defaults to 0.

  • 1 — Create the archive in chunks.
  • 0 — Create a single archive file.
1
tarroot string

The path to the directory in which you wish to store the  cpmove archive. 

This parameter defaults to /home/user , where user represents the username of the account. 

A valid absolute directory path./home/user
use_backups Boolean

Whether to use the account's last known successful backup as a template when the script creates the cpmove archive, if any exist.

Note:

This parameter may reduce the amount of time that the backup process requires.

This parameter defaults to 0

  • 1 — Use the account's last known successful backup as a template, if any exist.
  • 0 — Do not use the account's last known successful backup.
1

Returns

ReturnTypeDescriptionPossible valuesExample

session_id

stringThe backup's session ID.

A valid string.

example20151109162046c4xzDp55q9u4tPj
complete_master_logstring

The name of the master log.

Note:

The target system streams the output of this file with the live_tail_log.cgi script; however, users should not directly call this script.

A valid file name.
master.log
complete_master_error_logstring

The name of the master error log.

Note:

The target system streams the output of this file with the live_tail_log.cgi script; however, users should not directly call this script.

A valid file name.
master.error_log