Purge Completed Jobs for Certain Applications
search cancel

Purge Completed Jobs for Certain Applications

book

Article ID: 115271

calendar_today

Updated On:

Products

DSERIES- SERVER CA Workload Automation DE - System Agent (dSeries)

Issue/Introduction

I have a application which is triggered every 5 mins and I would like to purge these jobs at the end of the day.

Is there a command to purge completed jobs for certain applications only?

Environment

CA Workload Automation DE (dSeries) 11.3.x, 12.x
 

Resolution

Yes, you can purge completed jobs for certain applications only. If the application is "A", you can run the purgecompletedjobs cli command as below;

purgecompletedjobs olderthan("now less 10 days") application("A")

Additional Information

purgecompletedjobs Command—Clear the Server Completed Jobs Repository

When the server runs, it collects information about active and completed jobs. Your server relational database stores this information. The server completed jobs repository stores information related to completed jobs. To maintain performance, you must periodically clear the server completed jobs repository by issuing the PURGECOMPLETEDJOBS command.

Notes:

  • This command is used for CA WA Desktop Client tables and does not affect job history.
  • We recommand that you clear the server completed jobs repository after 10,000 jobs have been completed.
This command has the following format:
purgecompletedjobs [olderthan("olderthan")] [application("application")]

olderthan("olderthan")
(Optional) Clears completed jobs older than a scheduled time.

application("application")
(Optional) Clears completed jobs that belong to an Application. You can specify a generation number to clear completed jobs for a specific Application generation and its previous generations.

Note: You can use the asterisk (*) as a wildcard for zero or more characters and the question mark (?) as a wildcard for a single character.

Examples:
• application(“PAYROLL”) clears all completed jobs that belong to Application PAYROLL.
• application(“PAYROLL.5”) clears all completed jobs in generation 5 of Application PAYROLL and its previous generations.
• application(“APPL*”) clears all completed jobs that belong to Applications with names that start with APPL.

Example: Clear Completed Jobs in Certain Generations of an Application
The following example clears all the completed jobs that are older than two hours in generation 5 of Application APPLICATION_1 and its previous generations from the server:

purgecompletedjobs olderthan("now less two hours") application("APPLICATION_1.5")

Example: Clear Completed Jobs Belonging to Certain Applications Using a Wildcard
The following example clears all the completed jobs that are older than four days and belong to Applications with names that start with T (for example, TEST) from the server:

purgecompletedjobs olderthan("now less 4 days") application("T*")