Schedule deployment history cleanup

This topic explains how to run a one-time cleanup of your deployment history or schedule a series of regular cleanups. Use dynamic conditions to select applications and environments for the cleanup, based on custom rules.

Run deployment history cleanup

You run a deployment history cleanup to clear history data and logs for applications and/or environments.

Before running or scheduling a cleanup, review these topics:

To run a deployment history cleanup:

  1. In Deployment Automation, navigate to Administration > System.

  2. Select the Deployment History Cleanup tab.
  3. Click Schedule. The Deployment History Cleanup dialog box opens.

    Note: You can also schedule the cleanup from the Administration Timeline section. Navigate to Administration > Timeline, click Schedule, and select Deployment History Cleanup.

  4. Select the applications to clean up and click Next.

    To select applications based on dynamic conditions, see Use dynamic conditions.

  5. Select the environments to clean up and click Next.

    To select environments based on dynamic conditions, see Use dynamic conditions.

  6. Specify the following cleanup options and click Next.

    Option Description
    Name

    (Optional) Enter a name for the cleanup.

    Leave the field empty to use the default name, Deployment History Cleanup.

    Clean Up Logs Only

    (Optional) Select this option to clear only the logs for component processes, keeping the rest of deployment history.

    If a deployment history cleanup runs with the Clean Up Logs Only option, the Output and Error logs for cleaned component process requests is no longer available.

    Ignore Failure

    (Optional) Leave this option selected to always finish the cleanup successfully, even if the system fails to remove certain process requests.

    Note: The cleanup fails if an internal server error occurs or if you don't have proper permissions for the relevant environment.

    Process Execution Status

    Select the process request status for which you want to run the cleanup:

    • All (default). Clear deployment history for all process requests regardless of their status.

    • Success. Clear deployment history only for the process requests that completed successfully.

    • Failed. Clear deployment history for all failed process requests.

    • Canceled. Clear deployment history for all canceled process requests.

  7. Define how much deployment history to delete by setting the cleanup period. Use either a Start Date and End Date range or a Relative Time period. Then click Next.

    The following table describes the cleanup period settings.

    Option Description
    Start and End date range (default)

    Specify for what time period to delete history data:

    • The time zone to which Deployment Automation binds the date and time.

    • The Start date and time, according to the time zone.

    • The End date and time, according to the time zone.

    Relative Time
    1. Select the time zone to which Deployment Automation binds the relative time period.

    2. Specify the period for which to keep history data. Deployment history older than this period is removed.

      For example, to keep history from the last two months before the cleanup and remove all older data, set a period of 2 months.

  8. Click Submit. The cleanup starts immediately and runs until all the selected entities are cleaned up.

To schedule a cleanup for a specific date, or set up regular cleanups, see Schedule deployment history cleanup.

To review deployment history cleanup results, see Post-cleanup.

Back to top

Schedule deployment history cleanup

You can schedule a one-time history cleanup or set up regular cleanups.

To schedule a deployment history cleanup:

  1. Complete steps 1–7 in Run deployment history cleanup.
  2. Provide details for the cleanup time and duration:
    • The time zone to which Deployment Automation binds the schedule.

    • The Start date and time, according to the time zone.

    • The End date and time, according to the time zone.

  3. (Optional) To schedule regular cleanups, select Recurring and define the recurring pattern.

    Pattern Description
    Duration

    Specify how long you want the cleanup to run in hours and minutes.

    Note: Because the cleanup is limited to its duration, Deployment Automation might not finish clearing all the data until the cleanup time runs out. In such situations, the cleanup completes with the Timed out status.

    Repeat every

    Specify how often you want to run the cleanup in days, weeks, months, or years.

    For example, to repeat cleanups monthly, enter 1 and select Month from the list of patterns.

    Repeat on For the Week pattern, select days of the week, from Sunday to Saturday, on which you want to run the cleanup.
    Monthly options

    For the Month pattern, select one of the following:

    • On the exact day of the month. Schedule the cleanup for a specific calendar day. In the Day field, enter the day of the month. For example, to run the cleanup on the 10th of the month, enter 10.
    • Relative date. Run the cleanup on a relative day of the month. In the Repeat On field, set the pattern, for example, third Wednesday or last Monday of the month.
    Ends

    Specify when to stop the cleanups:

    • Never. Select this option to continue the cycle indefinitely.
    • On. Select a calendar date on which to stop the cleanups.
    • After. Enter a number of runs after which the cleanups must stop.
  4. Click Submit.

To view, edit, or delete a series of cleanups, navigate to the Administration Timeline. For details, see Change or delete scheduled cleanups.

To review deployment history cleanup results, see Post-cleanup.

Back to top

Use dynamic conditions

Dynamic conditions enable you to select entities for the cleanup based on custom rules.

For example, you can set rules to select applications and environments that contain specific properties and/or match specific values. The system removes history data only for those entities that match your conditions.

Dynamic conditions are based on the AND and OR rules. The following table describes the conditions.

Condition Description
The AND condition Enables you to make a selection based on a combination of conditions. Only those entities that match all the conditions are selected.

To apply the AND condition, add a new condition to the same condition group.
The OR condition Enables you to make a selection based on mutually exclusive conditions. Entities that match any of the conditions are selected.

To apply the OR condition, add a new condition group.

To set dynamic conditions:

  1. Complete steps 1–3 in Run deployment history cleanup.
  2. In the Deployment History Cleanup dialog box, set the conditions for applications.

    In Applications, select Use Dynamic Conditions. The Conditions section is displayed.

  3. From the Type list, select the condition type:

    • Name. Select applications based on their name.
    • Property. Select applications based on their properties.
  4. If you selected the Name condition:
    1. From the Comparison list, select a rule:

      RuleDescription
      EqualsThe application name must match your value.
      Select this option to clear history only for applications with the specified name.
      Does Not EqualThe application name must be different from your value.
      Select this option to clear deployment history for all applications other than the one you specify.
      Contains

      The application name must contain your value.
      Select this option to clear history for all applications with names that include the value you specify.

      For example, enter helloWorld to clean up all applications that have helloWorld in their name.

      Does Not Contain

      The application name must exclude your value.
      Select this option to clear history for all applications with names that don't include the value you specify.

      For example, enter helloWorld to clean up all applications that don't have helloWorld in their name.

      Starts With

      The application name must start with your value.
      Select this option to clear history for all applications with names starting with the value you specify.

      For example, enter helloWorld to clean up all applications with names starting with helloWorld.

      Matches Regex

      The application name must match your regular expression.
      Select this option to clear history for all applications with names matching the regular expression you specify.

      For example, enter the value [a-zA-Z]* to clean up applications with names containing uppercase and lowercase letters from A to Z.

    2. In the Value field, enter a value to use for comparison. Values are case-sensitive.
  5. If you selected the Property condition:
    1. In the Name field, enter the name of the property. Names are case-sensitive.

    2. From the Comparison list, select a comparison rule as described in step 4.
    3. In the Value field, enter the property value to be used for comparison. Values are case-sensitive.

      Example: To select applications that contain the port=8080 property-value pair, specify the following details:

      • Type: Property

      • Name: port

      • Comparison: Equals

      • Value: 8080

      To select applications that contain the port property with any or no value, select Matches Regex from the Comparison list and enter .* as Value.

  6. (Optional) To add another AND condition, click Add Condition.

    To add another OR condition, click Add Condition Group.

  7. After you set the conditions for applications, click Next.
  8. Set the conditions for environments by repeating steps 2–7.

    The list of applications and environments selected for the cleanup is updated every time you modify the conditions. The list of environments is based on your applications selection.

    Note: To view a list of applications or environments that match your conditions, expand the Applications or Environments section under the Conditions section.

  9. Complete the remaining steps as described in Run deployment history cleanup and Schedule deployment history cleanup.

Tip: Use dynamic conditions to schedule cleanups for applications or environments that haven't been created yet. As soon as entities matching your conditions are created, the system adds them to the cleanup list.

Back to top

Change or delete scheduled cleanups

You can edit or remove scheduled history cleanups. If you modify or delete a recurring cleanup, the changes apply to an entire series.

When a cleanup is running, you can cancel it. If it's a recurring cleanup, only the selected run is canceled.

To cancel a running cleanup:

  1. In Deployment Automation, navigate to Administration > System.

  2. Select the Deployment History Cleanup tab.
  3. In the list of cleanups, click Cancel next to the running cleanup and then confirm.

To edit scheduled cleanups:

  1. In Deployment Automation, navigate to Administration > Timeline.

  2. In the Timeline, select the cleanup and then click Edit next to it.
  3. In the Execution History Cleanup dialog box, click the section you want to edit, for example, Cleanup Period, and edit the settings.
  4. Click Save.

To remove scheduled cleanups:

  1. In Deployment Automation, navigate to Administration > Timeline.

  2. In the Timeline, select the cleanup you want to remove.
  3. Click Delete next to the cleanup and then confirm.

Back to top

Next steps: