Setting Up Filter/Obtaining Filter Group ID

Using the JetBackup 5 API with Ansible: manageBackupJob Errors and Fixes

If you're automating JetBackup 5 configuration via Ansible and find that your manageBackupJob API call completes without errors, but the backup job never actually appears in the JetBackup interface. There are two common culprits worth checking before digging any deeper. We've pulled together the most frequent issues and how to fix them below.

Why isn't my backup job being created even though the API call succeeds?

The JetBackup API will return success: 0 If the call fails, verify that you're checking the field in the API response, not just the Ansible task exit code. A task can be marked as ok from Ansible's perspective while the API itself silently rejects the request.

Check your JetBackup logs at:

/usr/local/jetapps/var/log/jetbackup5/

You'll see the raw API call that was submitted, which makes it easy to spot the exact parameters that were sent. The API log does not show the response success/failure, but you can reuse the same parameters in a manual API call to verify the response.

The two most common issues

1. Invalid time value must be a multiple of 5

The time parameter in manageBackupJob represents the scheduled backup time in HHMM format, and it must be a multiple of 5 to be valid. For example:

  • 125 = 1:25 AM ✅
  • 128 = invalid ❌

If a non-multiple-of-5 value is passed, the API will return: message: Invalid time provided. (Valid value is between 0 to 2355 in multiple of 5)

The fix is straightforward — update the time value in your Ansible variable to the nearest valid multiple of 5.

2. Incorrect filters array syntax

The filters parameter expects an Array of Arrays, not a flat array of IDs. Passing a single-level array like filters[0]=<id> will result in: message: Invalid data provided for field 'filters', Valid data types: Array of Array

The correct syntax is filters[0][0]=<id>, where the outer index is the filter group and the inner index is the filter within that group.

Additionally, the ID passed must be the filter group ID (group_id), not the filter's _id. To obtain the correct value:

  • When a filter is created using manageAccountFilter, a Filter Group will already exist by default.
  • You can find the Filter Group ID using listAccountFilterGroups as a shortcut, or by running listAccountFilters and using the group_id field from the results, both will return the same ID.
  • If using listAccountFilters, you can use the group_id value when assigning the filter to manageBackupJob.
  • Do not use the _id returned by listAccountFilters, that is a different identifier and will not work with manageBackupJob.

listAccountFilterGroups documentation: https://docs.jetbackup.com/v5.3/api/AccountFilters/listAccountFilterGroups.html

What does a working manageBackupJob call look like?

 

A valid API call with both filters and time correctly formatted looks like this:

jetbackup5api -F manageBackupJob -D "action=create&name=Daily&type=1& \ destination[0]=<destination_id>&time=125&filters[0][0]=<filter_group_id>& \ schedules[0][_id]=<schedule_id>&schedules[0][retain]=12"

When the parameters are correct, you should see: success: 1 message: Backup Job Created Successfully

Quick Reference

Parameter        Requirement
time        Must be between 0–2355 and a multiple of 5
filters        Must be an Array of Arrays: filters[0][0]=<id>
Filter ID source        Use _id from listAccountFilterGroups, not listAccountFilters

 

For full manageBackupJob documentation, visit: https://docs.jetbackup.com/v5.3/api/BackupJobs/manageBackupJob.html

If you have any questions that aren't addressed above, please don't hesitate to reach out to our 24/7 Support team for assistance.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Email Notifications Are Not Being Sent

JetBackup 5 uses Notification Integrations to send Notifications based on the configured...

What are the level of Alerts in JetBackup 5?

JetBackup 5 now has only 3 Alert levels compared to JetBackp 4. All 3 levels will appear on the...

Create Destination Error: This destination path is already owned by other destination

On JetBackup 5, you may notice the following error when creating a destination that uses the same...

Rsync Backing Up Account Fails - Error: overflow

There have been some reports of accounts failing to back up with errors similar to this:[ERROR]...

Common Backup Job Exclude List for DirectAdmin Accounts

Information regarding how to exclude certain files/folders from a backup in JetBackup 5 can be...