Job Retention Policy Using REST API

Learn how to manage the retention policy for migration audit logs using the DryvIQ REST API.


Overview

The Job Retention Policy allows the user to configure the deletion of old audit log entries from the database. The system job “Apply Job Retention Policies,” which runs every four hours, deletes the entries in the applicable job audit log.

Global Configurations

All settings can be set through the command line (--settingname=value) or through (SKYSYNC_settingname=value).

When using environment variables, replace the colon (:) with a double underscore (__). For example, server:port could be set using an environment variable named SKYSYNC_server__port=value

The order of precedence before the database is online is 

  1. Command-line
  2. Environment variables
  3. appSettings.json. 

However, once the license and database are online, the order of precedence changes to: 

  1. License
  2. Database (Configuration table)
  3. Command line
  4. Environment variables
  5. appSettings.json.
{
  "data": {
    "connection": "SERVER=(local);DATABASE=SkySyncV4;Integrated Security=SSPI",
    "provider": "sqlserver",
    "directory": "C:\\ProgramData\\SkySync\\v4",
  },
  "jobs": {
    "retention": {
      "duration" : {
         "type": "days",
         "count": 21
      },
      "purge_empty": true
    }
  },
  "license": {
    "activation_key": "{{license Key}}"
    }
  }
}

Job Configuration

Options Description Default Value
jobs:retention:duration:type

Retention type:

  • "all" – keep all records
  • "none" – removed all records
  • "number" - deletes records for execution exceeding count specified below
  • "days" - deleted records for execution older than count specified below
all
jobs:retention:duration:count The number of days or executions to keep records for

21 for type="days";

50 for type="number"

jobs:retention:purge_empty True/False flag specifying whenever to delete audit logs for executions which did not result in any file transfers false

Job JSON Example

{
	"name":"Simple Transfer Job with stop policy",
	"kind": "transfer",
	"transfer": {
    	"transfer_type": "copy",
	    "source": {
    		"connection": { "id": "{{nfs_connection_id}}" },
    		"target": {
    			"path": "/w/source"
    		}
    	},
    	"destination": {
    		"connection": { "id": "{{cloud_connection_id}}" },
    		"target": {
    			"path": "/w/destination"
    		}
    	}
	},
	"schedule": {
		"mode": "auto"
	},
	"retention": {
      "duration" : {
         "type": "number",
         "count": 50
      },
      "purge_empty": true
	}
}