Purging using batch

Running purge is an important maintenance activity to prevent gradual performance degradation due to the build-up of data in the database tables. Make sure you implement a purge routine as part of your EngageOne Server maintenance plan.

You can configure and run batch to purge work items for a given batch channel. This can be as part of a successful batch run. Here are some examples of how you can use the purge program:

Attention: Do not run Purge while Batch is running.
  • Purge all successful work items that were processed during this batch run and specified in the run itself.
  • Purge all work items for a given channel by channel name.
  • Specify a status set to delete work items that have had all channels delivered. Any template that has an un-delivered channel will have none of its channels purged, even if all other channels belonging to the same template have been delivered.
  • Purge the data in the database and the files in the file system when a community is deleted.

By default the purge program purges work items created or updated up to the day before the date the purge program is run. It is recommended that you validate work items that are scheduled to be purged.

The purge program supports removal of the following work items:

  • Complete and delivered work items.
  • Failed work items errors, for example, when work item delivery fails.
  • Work items that were already submitted for channel delivery (only delivery status Composed and beyond).

Work items are deleted based on the command line options specified to the purge function. Any physical files that are stored in the content repository, including the TDS working folder (activeContent, delivery and preview) and sub-files associated with the work item are also deleted. It also deletes corresponding database entries of those work items that were deleted.

If none of the three options listed in the purge program table below are specified, all work items with either an error or a delivered status will be included in the purge process.

Note: Files generated by batch such as print file, report file, index file and archive file are not deleted.

When a work item is deleted, all work item-related files, work item-related delivery items, and delivery item-related working files are deleted. When a delivery item is deleted, all delivery item-related working files are deleted. If all delivery items of a work item are deleted, the work item is deleted in the purge process, including database entries and related files.

The purge program also cleans up any interim files or database entries generated by delivery failure, such as delivery items with status New or Processing and the files in the non-accumulated batch working folder.

When the purge program runs it also checks for deleted communities. If any deleted communities are located, the purge program permanently deletes the deleted communities, including all related database entries and related files.

Purge is typically scheduled to run during non-peak hours. If you choose to run purge during peak operating hours, use the -concurrencyMode option.

purge
Function Executes a purge program. The purge behavior can be customized by supplying appropriate options.
  • Only the domain parameter is required.
  • Running purge with no status options (errored, delivered, pendingdelivery, or canceled) deletes any interim files and database entries corresponding with delivery items having New, Processing and Cancelled statuses. Files in the non-accumulated batch working folder are removed as well. This does not delete resources related to work items pending for delivery. Additionally, all delivered and errored work items are deleted.
  • The following options require an argument, which are indicated below as <variables>: -batch, -channel, -domain, and -logfile.
  • numDaysRetention defaults to zero if not specified.
  • Work items created or updated on the same day up to the purge start time are not included in the purge process.

    It is strongly recommended that you do not attempt to run the purge job for work items created on the same day to prevent removal of documents that might potentially still being processed by the document server.

    Also, do not run purge while batch is running.

Command Line Interface:
Script prompt> purge {options}
Example prompt> purge -errored

prompt> purge -delivered -numDaysRetention 3

Options
-batch <batch> the batch ID to run the purge
-cancelled deletes work items marked for removal (‘soft deleted’). Does not delete New or Processing items. This does not include errored, pending delivery, or delivered work items.
-channel <channel> name of the channel to run the purge
-concurrencyMode allows purge to run concurrently with other EngageOne processes (EngageOne Web Services, EngageOne Interactive, etc.) without impacting the performance of those processes
-delivered deletes delivered work items in the purge process and not the New or Processing items. This does not include errored, pending delivery, or cancelled items.
-domain <community> name of the community to run the purge
-errored deletes work items that have errors in the purge process and not the New or Processing items. This does not include delivered, pending delivery, or cancelled items.
-help print this message
-logfile <file> override log file name with given name
-maxLogFileCount maximum log file count, default is 10MB
-maxLogFileSize maximum log file size, default is 10
-numDaysRetention include in the purge process all work items older than the specified number of days (relative to the current date)
-pendingdelivery deletes items that have submitted and are pending for delivery. This does not include errored, delivered, or cancelled items.
-quiet does not write log output to console
-verbose write detailed information to the log
-workItemInDailyfolders From EngageOne 4.4.7 onwards, work items are created in their own folder on the active-drive. Prior to this release work items were created in the daily folders on the active-drive.

The purge program should be run prior to upgrading to clean up the work items in the daily folders. There may however be situations where not all work items were in a purgeable state at the time of upgrade; this legacy switch is provided to cater for this scenario. It allows the purge program to clean-up any work items remaining in the daily folders.

NOTE: This switch should only be used for the purpose described above and not set by default. If set by default, the purge program will not clean up work items in the new location on the active-drive.

purge-em
Function Purge old Event Monitor records for the dates given
Syntax purge-em -onOrBefore {yyyy-MM-dd}[-concurrencyMode]
Parameters
date all records that were logged before the given date will be purged
-concurrencyMode allows purge-em to run concurrently with other EngageOne processes (EngageOne Web Services, EngageOne Interactive, etc.) without impacting the performance of those processes
Example purge-em -onOrBefore 2009-11-27
purge - delivered - numDaysRetention 3
Java command example jjava -cp <libraries> com.pb.eventmonitor.purge.EventMonitorPurge -onOrBefore 2009-11-27 -verbose
purge-promotion
Function Purge all import and export promotion jobs for specific dates.
Syntax purge-promotion -onOrBefore {yyyy-MM-dd}
Parameters
date All import, export and asset export promotion-quartz jobs created before or on a specific date will be purged. If the date covers scheduled but not completed jobs, these jobs will be deleted as well.
Example purge-promotion -onOrBefore 2017-07-20
Java command example %JAVA_HOME%\bin\java -cp <libraries> -Dviewpoint.config.externalPropertyFilePath=../conf/viewpoint.properties com.pb.engageone.server.purge.promotion.AssetPromotionPurge -onOrBefore 2017-07-15
delete-old-version
Function Deletes all old versions of a template and Active Content, (including database records and physical files) from the content repository.
Command Line Interface
Script prompt> delete-old-version [options]
Example prompt> delete-old-version -verbose
Options
-help prints this message
-domain name of the community to run the purge
-quiet does not write log output to console
-verbose writes detailed information to the log