Page tree
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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "data": {
    "backup_config": {
      "backup_daily_enable": 1,
      "backup_weekly_enable": 1,
      "postbackup": 0,
      "backupenable": 1,
      "backup_monthly_enable": 1,
      "maximum_timeout": "2700",
      "backuptype": "compressed",
      "backup_daily_retention": "2",
      "backupdays": "0,1,2,3,4,5,6",
      "backup_monthly_dates": "1,15",
      "backupfiles": 1,
      "backupaccts": 1,
      "prebackup": "1",
      "backup_weekly_retention": "4",
      "psqlbackup": 0,
      "backup_weekly_day": "0",
      "keeplocal": "1",
      "localzonesonly": 0,
      "backupbwdata": 1,
      "backuplogs": 0,
      "linkdest": 0,
      "gziprsyncopts": "--rsyncable",
      "backupdir": "/backup",
      "errorthreshhold": 3,
      "backupmount": 0,
      "backup_monthly_retention": "1",
      "backupsuspendedaccts": 0,
      "mysqlbackup": "accounts"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "backup_config_get"
  }
}
 Output (XML)
<result>
    <data>
        <backup_config>
            <backup_daily_enable>1</backup_daily_enable>
            <backup_weekly_enable>1</backup_weekly_enable>
            <postbackup>0</postbackup>
            <backupenable>1</backupenable>
            <backup_monthly_enable>1</backup_monthly_enable>
            <maximum_timeout>2700</maximum_timeout>
            <backuptype>compressed</backuptype>
            <backup_daily_retention>2</backup_daily_retention>
            <backupdays>0,1,2,3,4,5,6</backupdays>
            <backup_monthly_dates>1,15</backup_monthly_dates>
            <backupfiles>1</backupfiles>
            <backupaccts>1</backupaccts>
            <prebackup>1</prebackup>
            <backup_weekly_retention>4</backup_weekly_retention>
            <psqlbackup>0</psqlbackup>
            <backup_weekly_day>0</backup_weekly_day>
            <keeplocal>1</keeplocal>
            <localzonesonly>0</localzonesonly>
            <backupbwdata>1</backupbwdata>
            <backuplogs>0</backuplogs>
            <linkdest>0</linkdest>
            <gziprsyncopts>--rsyncable</gziprsyncopts>
            <backupdir>/backup</backupdir>
            <errorthreshhold>3</errorthreshhold>
            <backupmount>0</backupmount>
            <backup_monthly_retention>1</backup_monthly_retention>
            <backupsuspendedaccts>0</backupsuspendedaccts>
            <mysqlbackup>accounts</mysqlbackup>
        </backup_config>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>backup_config_get</command>
    </metadata>
</result>

Note:

Use WHM's API Shell interface (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, postbackup, backupenable, backup_monthly_enable, usebinarypkgacct, backuptype, backup_daily_retention, backupdays, backup_monthly_dates, backupfiles, backupaccts, prebackup, psqlbackup, keeplocal, localzoneonly, backupbwdata, dieifnotmounted, backuplogs, linkdest, backupsuspendedaccounts, gziprsyncopts, backupdir, errorthreshhold, backupmount, mysqlbackup, and backup_monthly_retention returns.
 

backup_daily_enable

Boolean

Whether the daily backups are enabled.

The function returns this value in the backup_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

postbackup

Boolean

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

The function returns this value in the backup_config hash.

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

backupenable

Boolean

Whether the backups are enabled.

The function returns this value in the backup_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

backup_monthly_enable

Boolean

Whether the monthly backups are enabled.

The function returns this value in the backup_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
0

usebinarypkgacct

Boolean

The backup script to use.

The function returns this value in the backup_config hash.

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

backuptype

string

The type of backup to create.

The function returns this value in the backup_config hash.

  • compressed
  • uncompressed
  • incremental
compressed

backup_daily_retention

integer

How many daily backups to keep.

The function returns this value in the backup_config hash.

A positive integer.5

backupdays

string

Which days of the week to run 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-delimited list.

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

backup_monthly_dates

integer

Which days of the month to run 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-delimited list.

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

backupaccts

Boolean

Whether to back up accounts.

The function returns this value in the backup_config hash.

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

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

keeplocal

Boolean

Whether to delete backups from the local directory.

The function returns this value in the backup_config hash.

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

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

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

dieifnotmounted

Boolean

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

The function returns this value in the backup_config hash.

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

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

linkdest

Boolean

Whether to check rsync for hardlink support.

The function returns this value in the backup_config hash.

  • 1 — Check.
  • 0 — Do not check.
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

gziprsyncopts

string

gzip environment variables.

The function returns this value in the backup_config hash.

A valid string.--rysncable

backupdir

string

The primary backup directory.

The function returns this value in the backup_config hash.

An absolute file path./backup

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

backupmount

Boolean

Whether the system mounted a backup partition.

The function returns this value in the backup_config hash.

  • 1 — Mounted.
  • 0Not mounted.
0

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.
  • entire — Back up all of the databases in one file.
  • both — Back up databases into each account's archive and together in one file.
account s

backup_monthly_retention

integer

The number of monthly backups to keep.

The function returns this value in the backup_config hash.

A positive integer.5