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

Description


This function retrieves your backup destination configuration file data.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/backup_config_get?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/backup_config_get?api.version=1
 Command Line
whmapi1 backup_config_get


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)
{
   "metadata":{
      "result":1,
      "reason":"OK",
      "version":1,
      "command":"backup_config_get"
   },
   "data":{
      "backup_config":{
         "backupsuspendedaccts":1,
         "postbackup":0,
         "force_prune_weekly":"0",
         "backup_weekly_enable":0,
         "prebackup":"-1",
         "backup_daily_retention":"2",
         "mysqlbackup":"accounts",
         "maximum_restore_timeout":"21600",
         "backupaccts":1,
         "disable_metadata":0,
         "check_min_free_space":"1",
         "linkdest":"0",
         "backup_monthly_dates":"1",
         "backupbwdata":1,
         "errorthreshhold":"3",
         "backupdir":"/backup",
         "gziprsyncopts":"--rsyncable",
         "backupfiles":1,
         "min_free_space_unit":"percent",
         "backup_monthly_retention":"1",
         "backuptype":"incremental",
         "backupenable":1,
         "backuplogs":1,
         "min_free_space":"5",
         "backupmount":1,
         "backup_daily_enable":1,
         "psqlbackup":0,
         "force_prune_daily":"0",
         "backup_weekly_day":"0",
         "backup_weekly_retention":"4",
         "backupdays":"0,1,2,3,4,5,6",
         "localzonesonly":0,
         "backup_monthly_enable":0,
         "maximum_timeout":"7200",
         "force_prune_monthly":"0",
         "keeplocal":"1"
      }
   }
}
 Output (XML)
<result>
  <data>
    <name>backup_config</name>
    <backup_daily_enable>1</backup_daily_enable>
    <backup_daily_retention>2</backup_daily_retention>
    <backup_monthly_dates>1</backup_monthly_dates>
    <backup_monthly_enable>0</backup_monthly_enable>
    <backup_monthly_retention>1</backup_monthly_retention>
    <backup_weekly_day>0</backup_weekly_day>
    <backup_weekly_enable>0</backup_weekly_enable>
    <backup_weekly_retention>4</backup_weekly_retention>
    <backupaccts>1</backupaccts>
    <backupbwdata>1</backupbwdata>
    <backupdays>0,1,2,3,4,5,6</backupdays>
    <backupdir>/backup</backupdir>
    <backupenable>1</backupenable>
    <backupfiles>1</backupfiles>
    <backuplogs>1</backuplogs>
    <backupmount>1</backupmount>
    <backupsuspendedaccts>1</backupsuspendedaccts>
    <backuptype>incremental</backuptype>
    <check_min_free_space>1</check_min_free_space>
    <disable_metadata>0</disable_metadata>
    <errorthreshhold>3</errorthreshhold>
    <force_prune_daily>0</force_prune_daily>
    <force_prune_monthly>0</force_prune_monthly>
    <force_prune_weekly>0</force_prune_weekly>
    <gziprsyncopts>--rsyncable</gziprsyncopts>
    <keeplocal>1</keeplocal>
    <linkdest>0</linkdest>
    <localzonesonly>0</localzonesonly>	    
    <maximum_restore_timeout>21600</maximum_restore_timeout>
    <maximum_timeout>7200</maximum_timeout>
    <min_free_space>5</min_free_space>
    <min_free_space_unit>percent</min_free_space_unit>
    <mysqlbackup>accounts</mysqlbackup>
    <postbackup>0</postbackup>
    <prebackup>-1</prebackup>
    <psqlbackup>0</psqlbackup>
  </data>
  <metadata>
    <command>backup_config_get</command>
    <reason>OK</reason>
    <result>1</result>
    <version>1</version>
  </metadata>
</result>


Note:

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

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
backup_confighashA hash of backup configuration data.This hash includes the backup_daily_enable, backup_daily_retention, backup_monthly_dates, backup_monthly_enable, backup_monthly_retention, backup_weekly_day, backup_weekly_enable, backup_weekly_retention, backupaccts, backupbwdata, backupdays, backupdir, backupenable, backupfiles, backuplogs, backupmount, backupsuspendedaccounts, backuptype, check_min_free_space, disable_metadata, errorthreshhold, force_prune_daily, force_prune_monthly, force_prune_weekly, gziprsyncopts, keeplocal, linkdest, localzoneonly, maximum_restore_timeout, maximum_timeout, min_free_space, min_free_space_unit, mysqlbackup, postbackup, prebackup, psqlbackup, and returns.
 

backup_daily_enable

Boolean

Whether to enable daily backups. 

The function returns this value in the backup_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

backup_daily_retention

integer

The number of daily backups to retain.

The function returns this value in the backup_config hash.

A positive integer.5

backup_monthly_dates

integer

Which days of the month to run monthly backups.

The function returns this value in the backup_config hash.

A positive integer that represents the day of the month.

Note:

For multiple days, use a comma-separated list.

1

backup_monthly_enable

Boolean

Whether to enable monthly backups. 

The function returns this value in the backup_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
0

backup_monthly_retention

integer

The number of monthly backups to retain.

The function returns this value in the backup_config hash.

A positive integer.5

backup_weekly_day

integer

Which day of the week to run weekly backups.

The function returns this value in the backup_config hash.

  • 0 — Sunday.
  • 1 — Monday.
  • 2 — Tuesday.
  • 3 — Wednesday.
  • 4 — Thursday.
  • 5 — Friday.
  • 6 — Saturday.
0

backup_weekly_enable

Boolean

Whether to enable weekly backups. 

The function returns this value in the backup_config hash.

  • 1 — Enable.
  • 0 — Disable.
0

backup_weekly_retention

integer

The number of weekly backups to retain.

The function returns this value in the backup_config hash.

A positive integer.4

backupaccts

string

Whether to back up accounts.

The function returns this value in the backup_config hash.

Note:

This setting affects whether the system enables the File and Directory Restoration interface in cPanel & WHM. For more information, read the How to Manage Metadata Settings documentation.

  • yes — Back up.
  • no — Do not back up.
1

backupbwdata

Boolean

Whether to back up bandwidth tracking data.

The function returns this value in the backup_config hash.

  • 1 — Back up.
  • 0 — Do not back up.

 

1

backupdays

string

Which days of the week to run daily backups.

The function returns this value in the backup_config hash.

  • 0 — Sunday.
  • 1 — Monday.
  • 2 — Tuesday.
  • 3 — Wednesday.
  • 4 — Thursday.
  • 5 — Friday.
  • 6 — Saturday.

Note:

For multiple days, use a comma-separated list.

0,1,2,3,4,5,6

backupdir

string

The primary backup directory.

The function returns this value in the backup_config hash.

An absolute file path./backup

backupenable

string

Whether to enable backups. 

The function returns this value in the backup_config hash.

Note:

This setting affects whether the system enables the File and Directory Restoration interface in cPanel & WHM. For more information, read the How to Manage Metadata Settings documentation.

  • yes — Enabled.
  • no — Disabled.
1

backupfiles

Boolean

Whether to back up system files.

The function returns this value in the backup_config hash.

  • 1 — Back up.
  • 0 — Do not back up.
1

backuplogs

Boolean

Whether to back up the error logs.

The function returns this value in the backup_config hash.

  • 1 — Back up.
  • 0 — Do not back up.

 

0

backupmount

Boolean

Whether the system mounted a backup partition.

The function returns this value in the backup_config hash.

Note:

This setting affects whether the system enables the File and Directory Restoration interface in cPanel & WHM. For more information, read the How to Manage Metadata Settings documentation.

  • 1 — Mounted.
  • 0Not mounted.
0

backupsuspendedaccounts

Boolean

Whether to back up suspended accounts.

The function returns this value in the backup_config hash.

  • 1 — Back up.
  • 0 — Do not back up.

 

0

backuptype

string

The type of backup to create.

The function returns this value in the backup_config hash.

  • compressed
  • uncompressed
  • incremental
compressed

check_min_free_space

Boolean

Whether to ensure that the destination server possesses the minimum free disk space.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
  • 1 — Check the free disk space on the destination server.
  • 0 — Do not check the free disk space on the destination server.
1

disable_metadata

string

Whether the Backup system will create metadata when a backup runs.

Note:

We introduced this return in cPanel & WHM version 70.

The function returns this value in the backup_config hash.

Note:

This setting affects whether the system enables the File and Directory Restoration interface in cPanel & WHM. For more information, read the How to Manage Metadata Settings documentation.


  • yes — Disables metadata creation.
  • no — Enables metadata creation.
no

errorthreshhold

integer

The number of times that the system will try to use the additional backup destination.

The function returns this value in the backup_config hash.

A positive integer.3

force_prune_daily

Boolean

Whether to strictly enforce the value of the backup_daily_retention parameter.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
  • 1 — Strictly enforce the backup_daily_retention setting.
  • 0 — Only enforce the backup_daily_retention setting after a successful complete backup.
0

force_prune_monthly

Boolean

Whether to strictly enforce the value of the backup_monthly_retention parameter.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
  • 1 — Strictly enforce the backup_monthly_retention setting.
  • 0 — Only enforce the backup_monthly_retention setting after a successful complete backup.
0

force_prune_weekly

Boolean

Whether to strictly enforce the value of the backup_weekly_retention parameter.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
  • 1 — Strictly enforce the backup_weekly_retention setting.
  • 0 — Only enforce the backup_weekly_retention setting after a successful complete backup.
0

gziprsyncopts

string

gzip environment variables.

The function returns this value in the backup_config hash.

A valid string.--rysncable

keeplocal

Boolean

Whether to delete backups from the local directory.

The function returns this value in the backup_config hash.

Note:

This setting affects whether the system enables the File and Directory Restoration interface in cPanel & WHM. For more information, read the How to Manage Metadata Settings documentation.

  • 0 — Delete.
  • 1 — Do not delete.
1

linkdest

Boolean

Whether to check the rsync function for hardlink support.

The function returns this value in the backup_config hash.

  • 1 — Check.
  • 0 — Do not check.
0

localzonesonly

Boolean

Whether to use a local zonefile from the /var/named/domain.tld file or dnsadmin.

The function returns this value in the backup_config hash.

  • 1 — Use the /var/named/domain.tld file.
  • 0 — Use dnsadmin.
0

maximum_restore_timeout

integer

How long a restoration will attempt to run, in seconds. If the restoration does not succeed in this amount of time, it will stop.

The function returns this value in the backup_config hash.

A positive integer.21600

maximum_timeout

integer

How long a backup will attempt to run, in seconds. If the backup does not succeed in this amount of time, it will stop.

The function returns this value in the backup_config hash.

A positive integer.7200

min_free_space

string

The minimum amount of free disk space to check for on the destination server.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
A positive number.1024

min_free_space_unit

string

The units of measure of disk space for the min_free_space return.

Note:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the backup_config hash.
  • MB — Megabytes.
  • percent — Percent available.
MB

mysqlbackup

string

The method that the system uses to back up MySQL® databases.

The function returns this value in the backup_config hash.

  • accounts — Back up databases into each account's archive.
  • dir — Back up the entire MySQL directory.
  • both — Back up databases into each account's archive and the entire MySQL directory.
accounts

postbackup

Boolean

Whether to run the /usr/local/cpanel/scripts/postcpbackup script after the backup finishes.

The function returns this value in the backup_config hash.

  • 1 — Run the script.
  • 0 — Do not run the script.
0

prebackup

Boolean

Whether to run the usr/local/cpanel/scripts/precpbackup script before the system processes backups.

The function returns this value in the backup_config hash.

  • 1 — Run.
  • 0 — Do not run.

 

1

psqlbackup

Boolean

Whether to back up PostgreSQL® databases.

The function returns this value in the backup_config hash.

  • 1 — Back up.
  • 0 — Do not back up.

 

0

dieifnotmounted

Boolean

Whether to stop the backup process if the backup directory is not mounted.

Note:

We removed this return in cPanel & WHM version 64. 

The function returns this value in the backup_config hash.

  • 1 — Stop.
  • 0 — Do not stop.
0

usebinarypkgacct

Boolean

The backup script to use.

Note:

We removed this return in cPanel & WHM version 11.42. 

The function returns this value in the backup_config hash.

  • 1/usr/local/cpanel/scripts/pkgacct
  • 0/usr/local/cpanel/bin/pkgacct
0