Back up an account using the pkgacct script

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.
SecurityBasicAuth
Request
query Parameters
user
required
string <username>

The cPanel account to back up.

Example: user=username
compressionsetting
string or null
Default: null

Whether to compress the data in .gzip format.

  • compress - Compress the data.
  • null - Do not compress the data.
Value: "compress"
Example: compressionsetting=compress
incremental
integer
Default: 0

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.

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

Note:

When you use this parameter, the system creates the backup as an uncompressed archive.

Enum: 0 1
Example: incremental=1
low_priority
integer
Default: 0

Whether to run the background task with a reduced priority.

  • 1 — Run the backup as a low priority task.
  • 0 — Run the backup with normal priority.
Enum: 0 1
Example: low_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.
Example: mysqlver=5.5
serialized_output
integer
Default: 0

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.

  • 1 — Serialize the output.
  • 0 — Do not serialize the output.
Enum: 0 1
Example: serialized_output=1
skipacctdb
integer
Default: 0

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

  • 1 — Do not back up the account's databases.
  • 0 — Back up the account's databases.
Enum: 0 1
Example: skipacctdb=1
skipapitokens
integer
Default: 0

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

  • 1 — Do not back up the account's API tokens.
  • 0 — Back up the account's API tokens.
Enum: 0 1
Example: skipapitokens=1
skipauthnlinks
integer
Default: 0

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

  • 1 — Do not back up the account's external authentication credentials.
  • 0 — Back up the account's external authentication credentials.
Enum: 0 1
Example: skipauthnlinks=1
skipbwdata
integer
Default: 0

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

  • 1 — Do not back up the account's bandwidth data.
  • 0 — Back up the account's data.
Enum: 0 1
Example: skipbwdata=1
skipdnssec
integer
Default: 0

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

  • 1 — Do not back up the account's DNSSEC configuration.
  • 0 — Back up the account's DNSSEC configuration.
Enum: 0 1
Example: skipdnssec=1
skipdnszones
integer
Default: 0

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

  • 1 — Do not back up the account's DNS zone file information.
  • 0 — Back up the account's DNS zone file information.
Enum: 0 1
Example: skipdnszones=1
skipftpusers
integer
Default: 0

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

  • 1 — Do not back up the account's FTP user accounts.
  • 0 — Back up the account's FTP user accounts.
Enum: 0 1
Example: skipftpusers=1
skiphomedir
integer
Default: 0

Whether to skip the home directory's contents.

  • 1 — Do not back up the account's home directory.
  • 0 — Back up the account's home directory.
Enum: 0 1
Example: skiphomedir=1
skiplinkednodes
integer
Default: 0

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

  • 1 — Do not back up the account's linked server nodes configuration.
  • 0 — Back up the account's linked server nodes configuration.
Enum: 0 1
Example: skiplinkednodes=1
skiplogs
integer
Default: 0

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

  • 1 — Do not back up the account's log files.
  • 0 — Back up the account's log files.
Enum: 0 1
Example: skiplogs=1
skipresellerconfig
integer
Default: 0

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

  • 1 — Do not back up the account's reseller privileges.
  • 0 — Back up the account's reseller privileges.
Enum: 0 1
Example: skipresellerconfig=1
skipshell
integer
Default: 0

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

  • 1 — Do not back up the account's shell information and privileges.
  • 0 — Back up the account's shell information and privileges.
Enum: 0 1
Example: skipshell=1
skipvhosttemplates
integer
Default: 0

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

  • 1 — Do not back up the account's vhost templates.
  • 0 — Back up the account's vhost templates.
Enum: 0 1
Example: skipvhosttemplates=1
split
integer
Default: 0

Whether to create the cpmove archive in chunks.

  • 1 — Create the archive in chunks.
  • 0 — Create a single archive file.
Enum: 0 1
Example: split=1
tarroot
string

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

Note:

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

Example: tarroot=/home/user
use_backups
integer
Default: 0

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

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

Note:

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

Enum: 0 1
Example: use_backups=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/start_background_pkgacct
Request samples
whmapi1 --output=jsonpretty \
  start_background_pkgacct \
  user='username'
Response samples
application/json
{
  • "data": {
    • "complete_master_error_log": "master.error_log",
    • "complete_master_log": "master.log",
    • "session_id": "example20151109162046c4xzDp55q9u4tPj"
    },
  • "metadata": {
    • "command": "start_background_pkgacct",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}