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 /scripts/pkgacct script.

Notes:

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

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

Whether to skip the home directory's contents.

This value defaults to 0

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

     

 

 

 

 

 

 


1
use_backupsBoolean

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

This value defaults to 0

Note:

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

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

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 value defaults to 0

  • 1 — Send serialized output.
  • 0 — Do not send serialized output.
1
tarrootstring

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

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

A valid absolute directory path./home/user
compressionsettingstring

Whether to compress the data in .gzip format.

This value defaults to null

  • compress — Compress the data.
  • null — Do not compress the data.
compress
mysqlverstringThe minimum version of MySQL® that the system requires to restore the backed up database files.A valid version of MySQL that is available on the server.5.5
skipacctdbBoolean

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

This value defaults to 0

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

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

This value defaults to 0

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

Whether to run the background task with a reduced priority.

This value defaults to 0

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

Whether to create the cpmove archive in chunks.

This value defaults to 0.

  • 1 — Create the archive in chunks.
  • 0 — Create a single archive file.
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