WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_users_with_backup_metadata
- A server running WHM.
https://whm-server.tld:2087/json-api/get_users_with_backup_metadata
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_users_with_backup_metadata{ "data": { "accounts": [ … ] }, "metadata": { "command": "get_users_with_backup_metadata", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists all available cparchive files.
Note:
MM.DD.YYYYrepresents the file's date in month, date, and year format.HH-MM-SSrepresents the file's timestamp in hour, minute, and second format.
The function checks the following filenames, where USER represents the cPanel account's filusername::
cpmove-USERcpmove-USER.tarcpmove-USER.tar.gzUSER.tarUSER.tar.gzbackup-{MM.DD.YYYY}{HH-MM-SS}{USER}.tarbackup-{MM.DD.YYYY}{HH-MM-SS}{USER}.tar.gz
The function checks for these filenames in the following locations:
/home/home2/home3/root/usr/usr/home/web
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_cparchive_files
- A server running WHM.
https://whm-server.tld:2087/json-api/list_cparchive_files
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_cparchive_files{ "data": { "quickrestore_files": [ … ] }, "metadata": { "command": "list_cparchive_files", "reason": "OK", "result": 1, "version": 1 } }
Request
This function backs up an account with the pkgacct script.
Note:
- The
/usr/local/cpanel/scripts/pkgacctscript logs results to the/var/cpanel/pkgacct_sessions/session_id/directory, wheresession_idrepresents 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.cgiscript on the source system. Users should not directly call this script.
Whether to compress the data in .gzip format.
compress- Compress the data.null- Do not compress the data.
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.
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.
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.configfile. - This parameter defaults to the current installed version of MySQL.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Whether to create the cpmove archive in chunks.
1— Create the archive in chunks.0— Create a single archive file.
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.
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_pkgacct
- A server running WHM.
https://whm-server.tld:2087/json-api/start_background_pkgacct
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_pkgacct?user=username&compressionsetting=compress&incremental=1&low_priority=1&mysqlver=5.5&serialized_output=1&skipacctdb=1&skipapitokens=1&skipauthnlinks=1&skipbwdata=1&skipdnssec=1&skipdnszones=1&skipftpusers=1&skiphomedir=1&skiplinkednodes=1&skiplogs=1&skipresellerconfig=1&skipshell=1&skipvhosttemplates=1&split=1&tarroot=%2Fhome%2Fuser&use_backups=1'{ "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 } }