Last modified November 7, 2024

manageBackupJob

This function allows you to create/modify the Backup Job Object.
Parameter name Type Description Possible values Example
action String REQUIRED Sets the flag to either create or modify.
create
modify
action=create
_id String REQUIRED on action modify. The Backup Job ID. N/A _id=5f8a7d0d348232507c4e7f02
type Integer REQUIRED on action create. The Backup Type.
Accounts 1
Directories 2
Server Backup (BMR) 4
type=1
name String REQUIRED on action create. The name given to the Backup Job for internal use. N/A name=Daily Backup
destination List [] REQUIRED on action create. List of the Destination IDs you will perform backups to. N/A destination[0]=5fcedb7e4caee42621624bc2
contains Integer REQUIRED on action create. Value indicating what the backup contains. View all possible Contains Values below. contains=511
options Integer Choose whether you would like to exlude databases, include email contents and exclude email junk
0 Include Databases
1 Exclude Email Contents
2 Include Emails Contents
4 Exclude Databases and Exclude Junk
6 Include Junk
options=4
structure Integer REQUIRED on action create. The Integer value for Backup Structure.
Incremental 1
Archived 2
Compressed 4
structure=1
retry_failed Integer Choose whether you want to retry backing up failed items for one more time.
  • 0 = No
  • 1 = Yes
retry_failed=1
include_list List [] List of File/Directory Paths to Include for Directories Backup Types. N/A include_list[0]=/home/acct/textfile
exclude_list List [] List of File/Directory Paths to Exclude for All Backup Types. N/A exclude_list[0]=/usr/local/tmp&exclude_list[1]= /usr/local/tmp2
filters List [] List of Account Filter Object Group IDs to use for Backup Job. The Filters List is a 2D List to simulate Logical AND/OR. The list of filter IDs in a single row have the Logical OR. The list of filter IDs in different rows use the Logical AND. N/A filters[0][0]=617355f0c255bc71ee70f393&filters[0][1]=61735fe403a9b8200d6996b3&filters[1][0]=61737c0a29c3e916132b2b93&filters[1][1]=618d9d66b3814e1e082f1dc3
schedules List [] List of Schedule Object Data to assign to the Backup Job. Note: the Schedule Object must be created prior to assigning. Each schedule requires the following fields.
_id Schedule Object ID
retain Integer value for retention
schedules[0][_id]=613f60409129f94ae3631d22&schedules[0][retain]=0
time Integer The time you would like the backup job to run in 24 Hour format. N/A time=0350
monitor List [] List of the Job Monitor values in days.
ranfor Integer
notran Integer
monitor[ranfor]=1&monitor[notran]=2
owner String Owner(ID) of the Backup Job. The owner and his parent will have permissions to modify/delete this backup job. Owner will default to current logged-in user. owner=630e811f4ad52176890b3026
disabled Boolean Flag to know if a Backup Job is Disabled 1/0 disabled=0

Example Call JETAPI

jetbackup5api -F manageBackupJob -D \
  "action=create&\
  name=API Backup Job&\
  owner={$OWNER_ACCOUNT_ID}&\
  owner_name={$OWNER_ACCOUNT_NAME}&\
  destination[0]={$DESTINATION_ID1}&\
  destination[1]={$DESTINATION_ID2}&\
  type=1&\
  contains=511&\
  structure=1&\
  filters[0][0]={$GROUP_FILTER_ID1}&\
  filters[1][0]={$GROUP_FILTER_ID2}&\
  filters[1][1]={$GROUP_FILTER_ID3}&\
  exclude_list[0]=.MirrorSearch&\
  exclude_list[1]=*/.wysiwygPro_*&\
  exclude_list[2]=*/core.[0-9]*& \
  schedules[0][_id]={$SCHEDULE_ID1}&\
  schedules[0][retain]=5&\
  schedules[1][_id]={$SCHEDULE_ID2}\
  schedules[1][retain]=5&\
  time=2330&\
  monitor[ranfor]=1&\
  monitor[notran]=1"
success: 1
message: Backup Job Updated/Created Successfully
system:
  version: 5.3.3
  version_panel: 5.3.3
  tier: EDGE
  type: cPanel
  retry_ms: 0
  disableui:
  dr:
  agreement_panel:
  agreement:
  licenseIssue:
data:
_id: 6504c79fd4b57d536c05bbe2
name: testjob
destination:
  0: 6503eec8ebbf07708d06f1d2
destination_details:
  0:
    _id: 6503eec8ebbf07708d06f1d2
    name: s3
    owner: 6503d48bfc45b1addf0a9632
    owner_name: root
    type: S3
    job_type: 1
    count: 2
    hidden:
    readonly:
    disabled:
    disk_limit: 0
    disk_usage:
    threads: 10
    update_date: 2023-09-15T20:28:13+00:00
    dr: 1
    reindex:
    running:
    options:
      path: /test
      access_key:
      secret_key: JB|HIDDEN|********************
      region: us-west-1
      bucket: bucket
      endpoint: s3.us-west-1.amazonaws.com
    legacy:
type: 1
contains: 511
structure: 1
options: 0
state: 0
owner: 6503d48bfc45b1addf0a9632
owner_name: root
next_run:
last_run:
running:
retry_failed: 0
disabled: 0
time: 1700
backup_quota:
monitor:
  ranfor: 0
  notran: 0
manually_retain: 0
exclude_list:
  0: /home
  1: /root
encrypted: 0
schedules:
hooks:
mysql_exclude_db_by_size: 0
postgresql_exclude_db_by_size: 0
mongodb_exclude_db_by_size: 0
filters:
  0:
    0: 6503e82270c7bdb29f08c6b3
    1: 6503e82270c7bdb29f08c6b3

Example Call HTTP

https://hostname.example.com:2087/cpsess##########/cgi/addons/jetbackup5/api.cgi?function=manageBackupJob&action=create&type=1&structure=1&name=Daily Backup Job Test&destination[0]=6136645f99b3fd3b3f07e902&contains=511&schedules[0][_id]=613f60409129f94ae3631d22&schedules[0][retain]=30