Auto Delete Task

For the most up-to-date documentation, please visit docs.brix.ch

The "Auto Delete Task" plugin will automatically delete assets that have reached a certain age. This is useful in a "transfer folder" scenario, where assets are only uploaded in order to be transferred to some 3rd party via PIN-Code or similar, whereafter the assets are no longer needed.

General properties

To be configured in {home}/appserver/conf/custom.properties

autoDeleteTask.license

type: String, required: yes, default: -

The license key for the plugin (product: autoDeleteTask), provided by brix.

autoDeleteTask.dryRun

type: boolean, required: no, default: false, since: 2.0

When enabled, no action will actually be taken, but the task log will show what it would have done. Useful for testing your initial config.

autoDeleteTask.nodesMaxAgeHours

type: List of String (comma-separated), DEPRECATED, use task properties, default: -

Defines a mapping from nodes to their max age (relative to the creation date of the asset) in hours, after which its content should be deleted.

For example 1400:24,1800:168 will delete assets older than 24h in node 1400, and assets older than 7 days in node 1800.

Task properties

This plugin can have multiple different configurations (as of 2.0) in the format of autoDeleteTask.i.something, where i is a number. We''l use i = 1 as an example here:

autoDeleteTask.1.enabled

type: boolean, required: no, default: true, since: 2.0

Whether this particular config is enabled or not.

autoDeleteTask.1.nodeId

type: long, required: probably, except when nodeTypeId is configured, default: - , since: 2.0

Which node to look for old assets (or nodes) in, recursively. When neither this nor nodeTypeId is set, the config will be disabled.

autoDeleteTask.1.nodeTypeId

type: long, required: maybe, when nodeId is not configured, default: - , since: 2.0

Same as nodeId, but it looks in an entire node type (a.k.a. main view tab). When neither this nor nodeTypeId is set, the config will be disabled.

autoDeleteTask.1.maxAge

type: long, required: yes, default: - , since: 2.0

What the maximum age (in hours) of an asset or node should be, before it gets deleted/unlinked. If this is not set, the config will be disabled.

autoDeleteTask.1.nodeMode

type: boolean, required: no, default: false, since: 2.0

In nodeMode, the subnodes of the configured node (-type) will be checked for their age and scheduled for deletion, regardless of whether they contain assets or not. Probably only useful for non-premission-defining nodes (e.g. collections).

autoDeleteTask.1.notIfLinkedToOtherNodes

type: boolean, required: no, default: true, since: 2.0

If the asset is also linked to other nodes, just unlink it from the current node instead of deleting it. Only applies when nodeMode=false.

autoDeleteTask.1.cleanUpEmptyFolders

type: boolean, required: no, default: true, since: 2.0

When empty folders are left behind through deletion of the contained assets, remove the (now empty) folder as well. Only applies when nodeMode=false.

autoDeleteTask.1.notIfHasChildNodes

type: boolean, required: no, default: true, since: 2.0

Whether to leave a node untouched when it still contains sub-nodes. Only applies when nodeMode=true.

autoDeleteTask.1.relevantDateField

type: String, required: no, default: modified, since: 2.0

Which date field to consider when determining the age of an asset or node. One of created, modified (default) or binary (assets only).

Example

### Auto Delete Task
autoDeleteTask.license=...
# remove from trashbin after 30d
autoDeleteTask.1.nodeId=1685
autoDeleteTask.1.maxAge=720
# remove collections after 1y
autoDeleteTask.2.nodeTypeId=102
autoDeleteTask.2.maxAge=8760
autoDeleteTask.2.nodeMode=true

Compatibility Matrix

autoDeleteTask CELUM
1.0 - 1.1 5.12.2
1.2 - 1.3 5.12.3 (tested up to 6.4)
2.0 5.12.3 (tested up to 6.5.2)

Release Notes

1.0

  • Initial Version

1.1

1.2

  • made the extension trashbin-aware (i.e. if you have a trashbin, deleting an asset would only move it to the trashbin - now it gets deleted from there as well)

1.3

  • added license check

2.0

  • Refactoring to allow multiple auto delete configurations (partially a breaking change, nodesMaxAgeHours will be auto-converted to the new format (nodeId= and maxAge=), the rest won't)
  • Enable deletion on an entire node type
  • Enable deletion of nodes (until now only nodes that were empty because assets were removed from it could be auto-deleted)
  • Added configurable date source (until now only the modification date was considered)