latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Backups
Backup Settings

Update the system's backup configuration

This function configures a server's backup system. The system saves these settings in the /var/cpanel/backups/config file.

get/backup_config_set

Query parameters

backup_daily_enable0 | 1
Example:1

Whether to enable daily backups.

  • 1 — Enable.
  • 0 — Disable.
backup_daily_retentioninteger
Example:5

The number of daily backups to retain.

backup_monthly_datesinteger
Example:1

Which days of the month to run backups.

Note:

To add multiple days, use a comma-delimited list.

backup_monthly_enable0 | 1

Whether to enable monthly backups.

  • 1 — Enable.
  • 0 — Disable.
backup_monthly_retentioninteger
Example:5

The number of monthly backups to retain.

backup_weekly_dayinteger
Example:1

Which day of the week to run weekly backups.

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

Whether to enable weekly backups.

  • 1 — Enable.
  • 0 — Disable.
backup_weekly_retentioninteger
Example:4

The number of weekly backups to retain.

backupaccts0 | 1
Example:1

Whether to back up cPanel user accounts.

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

Note:

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

backupbwdata0 | 1
Example:1

Whether to back up bandwidth tracking data.

  • 1 — Back up.
  • 0 — Do not back up.
backupdaysstring
Example:0,1,2,3,4,5,6

Which days of the week to run daily backups.

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

Note:

For multiple days, use a comma-delimited list.

backupdirstring
Example:/backup

The primary backup directory.

backupenable0 | 1

Whether to enable backups.

  • 1 — Enable.
  • 0 — Disable.

Note:

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

backupfiles0 | 1
Example:1

Whether to back up system files.

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

Whether to back up the error logs.

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

Whether to mount a backup partition.

  • 1 — Mount.
  • 0 — Do not mount.

Note:

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

backupsuspendedaccts0 | 1

Whether to back up suspended accounts.

  • 1 — Back up.
  • 0 — Do not back up.
backuptype'compressed' | 'uncompressed' | 'incremental'
Example:compressed

The type of backup to create.

  • compressed
  • uncompressed
  • incremental
check_min_free_space0 | 1
Example:1

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

  • 1 — Check the free disk space on the destination server.
  • 0 — Do not check the free disk space on the destination server.
disable_metadata0 | 1

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

  • 1 — Disable metadata creation.
  • 0 — Enable metadata creation.

Note:

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

errorthreshholdinteger
Example:3

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

force_prune_daily0 | 1

Whether to strictly enforce the value of the backup_daily_retention parameter.

  • 1 — Strictly enforce the backup_daily_retention parameter.
  • 0 — Only enforce the backup_daily_retention parameter after a successful complete backup.
force_prune_monthly0 | 1

Whether to strictly enforce the value of the backup_monthly_retention parameter.

  • 1 — Strictly enforce the backup_monthly_retention parameter.
  • 0 — Only enforce the backup_monthly_retention parameter after a successful complete backup.
force_prune_weekly0 | 1

Whether to strictly enforce the value of the backup_weekly_retention parameter.

  • 1 — Strictly enforce the backup_weekly_retention parameter.
  • 0 — Only enforce the backup_weekly_retention parameter after a successful complete backup.
gziprsyncoptsstring
Example:--rysncable

The gzip environment variables.

keeplocal0 | 1
Example:1

Whether to delete backups from the local directory.

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

Note:

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

linkdest0 | 1

Whether to check the rsync function for hardlink support.

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

Whether to use a local zone file from the /var/named/domain.tld file or the dnsadmin daemon, where domain.tld represents the target domain.

  • 1 — Use the /var/named/domain.tld file.
  • 0 — Use dnsadmin.
maximum_restore_timeoutinteger
Example:21600

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

maximum_timeoutinteger
Example:7200

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

min_free_spaceinteger
Example:1024

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

Note:

If the value of the min_free_space_unit parameter is percent, the maximum value is 100.

min_free_space_unit'MB' | 'percent'
Example:MB

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

  • MB — Megabytes.
  • percent — Percent available.
mysqlbackup'accounts' | 'dir' | 'both'
Example:accounts

The backup method to use for MySQL® databases.

  • accounts — Back up databases in each account's archive.
  • dir — Back up the entire MySQL directory.
  • both — Back up databases in each account's archive and the entire MySQL directory.
postbackup0 | 1

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

  • 1 — Run.
  • 0 — Do not run.
prebackup0 | 1
Example:1

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

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

Whether to back up PostgreSQL® databases.

  • 1 — Back up.
  • 0 — Do not back up.
remote_restore_staging_dirstring
Example:/backup

The directory that temporarily stores a remote backup's data during a backup restoration. The data is a compressed (.tar.gz) or uncompressed (.tar) account tarball.

Important:

The system restores backups one at a time. The backup staging directory must be large enough to contain the largest remote backup file that you wish to restore. For example, if you wish to restore three backups, sized 1.5 GB, 528 MB, and 950 MB each, your backup staging directory must be able to hold at least 1.5 GB.

Note:

The system empties the directory after the system restores the backup.

Response

HTTP Request was successful.

Example response

{
  "metadata": {
    "command": "backup_config_set",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}