2.178 PURGEOLDTASKS

Valid for

Manager

Description

Use PURGEOLDTASKS to purge Extract and Replicat tasks after a specific amount of time or when they have stopped gracefully.

You can indicate when to delete a task according to the following rules:

  • The task was last started a specific number of days or hours ago. If the task never was started, then its creation time is used as the basis for applying the rules.

  • The task stopped gracefully or never was started. This rule takes precedence over the time the task was last started. Use this rule to prevent abnormally terminated tasks from being purged.

Default

None

Syntax

PURGEOLDTASKS process_type group_name [, purge_option]
process_type

Valid values:

  • EXTRACT

  • REPLICAT

  • ER (for both processes)

group_name

The group name or a wildcard to specify multiple groups.

purge_option

Purges if the task has not been updated for a specific number of hours or days.

Valid values:

  • AFTER number DAYS

  • AFTER number HOURS

USESTOPSTATUS

Purges if the task was stopped gracefully or never was started.

Example

The following example deletes Extract tasks updated at least three days ago, and it deletes the INITREP Replicat task if it stopped gracefully and was updated at least two hours ago.

PURGEOLDTASKS EXTRACT *, AFTER 3 DAYS
PURGEOLDTASKS REP INITREP, AFTER 2 HOURS, USESTOPSTATUS