BPMSnapshotCleanup command

Use the BPMSnapshotCleanup command to delete unnamed and archived snapshots of a process application or toolkit on a Process Center server.

From a Process Center server, use the BPMSnapshotCleanup command to delete unused snapshots of a process application when they are obsolete or older than a specified snapshot.

The BPMSnapshotCleanup command is run using the AdminTask object of the wsadmin scripting client.

Prerequisites

Note: In an environment with multiple security domains configured, use the PALService MBean instead of this wsadmin command. See The Process Application LifeCycle (PAL) MBean.
Important: Before you use this command, you must install interim fixes. See the Issues with BPMDeleteSnapshot and BPMSnapshotCleanup commands in IBM Business Process Manager (BPM) flash technote.
The following conditions must be met:
  • Run the command in the connected mode, that is, do not use the wsadmin -conntype none option.
  • Use the BPMSnapshotCleanup command in connected mode from a Process Center server. In a network deployment environment, you must run this command on the node containing the application cluster member that handles Process Center applications. Do not run this command from the deployment manager profile.

  • Note: If you are using a SOAP connection, the command can take longer to complete than the specified SOAP timeout value. Although the command continues to run until it is finished, you might see the exception java.net.SocketTimeoutException: Read timed out. To prevent this exception, set a higher value for the com.ibm.SOAP.requestTimeout property in the profile_root/properties/soap.client.props file.
  • You must be a repository administrator.
  • You cannot delete the first snapshot of a process application even though it might be unnamed or archived. The first snapshot contains original information about the snapshot that is displayed in the history panel in Process Designer.
  • You cannot delete the tip snapshot, which is the most recent snapshot.
  • You must archive named snapshots before you delete them.
  • Before running the BPMSnapshotCleanup command, go to the Process Designer Inspector and remove all BPD instances that are related to the unnamed or archived snapshot that you want to delete.
  • To avoid conflicts between operations and snapshots on the Process Center, you must run the BPMSnapshotCleanup command at specified intervals. Run the command when there are no operations on the Process Center and no connections between the Process Designer and the Process Center.

Location

Start the wsadmin scripting client from the profile_root/bin directory.

Syntax

BPMSnapshotCleanup 
-containerAcronym process_application_acronym
[-containerSnapshotAcronyms process_application_snapshot_acronym]
[-containerTrackAcronym track_acronym]
[-keptNumber number_of_unnamed_snapshots_to_keep]
[-createdBeforeLocal local_time_on_the_server]
[-createdAfterLocal local_time_on_the_server]
[-createdBeforeSnapshotAcronym snapshot_acronym]
[-deleteArchivedSnapshot true|false]
[-ignoreDependency false]
[-outputFile output_file_name]

Parameters

You can delete unnamed snapshots and archived snapshots by using the same BPMSnapshotCleanup command with different parameters. You can also delete snapshots in batches for better performance.
Note: You must set at least one of the optional parameters such as containerSnapshotAcronyms, keptNumber, createdBeforeLocal, createdAfterLocal, or createdBeforeSnapshotAcronym as the filter for the BPMSnapshotCleanup command.
-containerAcronym process_application_acronym
A required parameter that identifies the process application that contains the snapshots to be deleted. For example, the BillingDispute process application might have an acronym of BILLDISP.
Tip: If you do not know the acronym for a parameter, use the BPMShowProcessApplication command to list the details of a process application, including acronyms.
-containerTrackAcronym track_acronym
An optional parameter that identifies the acronym of the track that contains the snapshots to be deleted. If this parameter is not specified, the default track is used.
-containerSnapshotAcronyms process_application_snapshot_acronym
An optional parameter that identifies the acronyms for the set of archived snapshots to be deleted. You can specify a single snapshot acronym or a list of acronyms separated by spaces, for example, -containerSnapshotAcronyms [SS2.0.1 SS2.0.2]. If this parameter is specified, you cannot specify other filters, such as values for the keptNumber, createdBeforeLocal, createdAfterLocal, createdBeforeSnapshotAcronym, or deleteArchivedSnapshot parameters.
-keptNumber number_of_unnamed_snapshots_to_keep
An optional parameter that uses an integer to identify the number of unnamed snapshots to keep when a snapshot cleanup is run. The most recent snapshots are kept. The tip snapshot is not counted in keptNumber.
  • If keptNumber is greater than or equal to the total number of unnamed snapshots, no snapshots are deleted.
  • If keptNumber equals 0, all the unnamed snapshots are deleted except the tip snapshot.
The keptNumber parameter cannot be specified with the createdBeforeLocal or createdAfterLocal parameters.
-createdBeforeLocal local_time_on_the_server
An optional parameter that specifies a local time value in string format for filtering unnamed snapshots by the date they were created. Unnamed snapshots are deleted if they were created before the specified time. When createdBeforeLocal is used with the createdAfterLocal parameter, createdBeforeLocal deletes the set of snapshots that were created within the specified time period. The specified value can have a yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds) or yyyy-MM-dd string format.
-createdAfterLocal local_time_on_the_server
An optional parameter that specifies a local time value in string format for filtering unnamed snapshots by the date they were created. Unnamed snapshots that are created after the specified time are deleted. When createdAfterLocal is used with the createdBeforeLocal parameter, createdAfterLocal deletes the set of snapshots that were created within the specified time period. The specified value can have a yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds) or yyyy-MM-dd string format.
-createdBeforeSnapshotAcronym snapshot_acronym
An optional parameter that specifies the acronym of a named snapshot. Unnamed snapshots are deleted if they were created before the specified snapshot. When createdBeforeSnapshotAcronym is used with the keptNumber parameter, the number of snapshots that are specified is retained. When createdBeforeSnapshotAcronym is used with the createdBeforeLocal or createdAfterLocal parameters, createdBeforeSnapshotAcronym deletes the unnamed snapshots that were created between the time when the named snapshot was created and the time that is specified by the createdBeforeLocal or createdAfterLocal parameter.
-deleteArchivedSnapshot true|false
An optional parameter of the Boolean type that specifies whether the archived named snapshot is deleted with the snapshots that are identified by the filter parameters. If you set the value of deleteArchivedSnapshot to true, both archived and unnamed snapshots are deleted in one command. By default, deleteArchivedSnapshot is set to false.
When deleteArchivedSnapshot is set to true and is used with other filter parameters, such as keptNumber, createdBeforeLocal, createdAfterLocal, and createdBeforeSnapshotAcronym, both archived snapshots that match the conditions that are specified by the other filter parameters and the unnamed snapshots are deleted.
ignoreDependency false
An optional parameter of the Boolean type that specifies whether to delete snapshots that other project applications depend on. This parameter is set to false. Do not change the default value.
-outputFile output_file_name
An optional parameter that specifies a qualified file path to write the snapshot cleanup log entries. The default log file is systemout.log.

Examples

The following examples illustrate how to delete snapshots that use the BPMSnapshotCleanup command.

Delete unnamed snapshots that are based on the keptNumber parameter
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -containerTrackAcronym Main -keptNumber 100]')
Delete unnamed snapshots that are based on a time span that fall within a particular time range
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-01-01T00:00:00 
-createdBeforeLocal 2012-02-31T21:37:06]')
Delete unnamed snapshots that are based on the createdBeforeLocal parameter
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeLocal 2012-01-02T21:37:06]') 
OR:
wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeLocal 2012-05-02 
-deleteArchivedSnapshot true]')
Delete unnamed snapshots that are based on the createdAfterLocal parameter
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-05-31T21:38:00]') 
OR: 
wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-07-31 
-deleteArchivedSnapshot true]')
Delete unnamed snapshots that are based on the createdBeforeSnapshotAcronym parameter
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeSnapshotAcronym SS2.0.1]')
Delete a specified archived snapshot
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

wsadmin>AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -containerTrackAcronym Main 
-containerSnapshotAcronyms SS2.0.1]')