Skip to main content
Skip table of contents

Prune the Database

The following describes how to add a Historical Events Driver to prune the database and report on legacy events. To complete the example operation, a Historical Events Driver must be added and started in the Hardware module.

Prune Historical Events

The third automation rule will be configured to prune live events.

  1. Go to Configuration > Automation Rules.

  2. Select Add. Name the automation rule Prune Live Events.

  3. Next to Trigger, select New, then select Periodic for the trigger interval.

  4. In Periodic, go to Interval and select Daily.

  5. For Time of day, enter the time which the trigger should occur in 24-hour format. For this example, enter 21:00 (09:00 PM).

  6. Press OK.

  7. Next to Actions, select Add.

  8. In Device Command, select Single, then select Choose. Select the Historical Events Driver.

  9. Press OK.

  10. Next to Command, select Choose, then select Start Pruning Historical Events.

  11. Press OK, then press Save and Close.

  12. Press Save and Close.

Stop Pruning Historical Events

The fourth action will be configured to stop pruning live events. To do this, follow the steps as outlined in the previous section, however the Time of Day will be the time to stop pruning live events and the Device Command will be to Stop Pruning Live Events.

  1. Go to Configuration > Automation Rules.

  2. Select Add. Name the automation rule Stop Pruning Live Events.

  3. Next to Trigger, select New, then select Periodic for the trigger interval.

  4. In Periodic, go to Interval and select Daily.

  5. For Time of day, enter the time which the trigger should occur in 24-hour format. For this example, enter 05:30 (5:30 AM).

    • Note: The trigger time must be set to stop pruning after the selected time to start pruning.

  6. Press OK.

  7. Next to Actions, select Add.

  8. In Device Command, select Single, then select Choose. Select the Historical Events Driver.

  9. Press OK.

  10. Next to Command, select Choose, then select Stop Pruning Historical Events.

  11. Press OK, then press Save and Close.

  12. Press Save and Close.

Create a Report on Legacy Events

Next, create a report on legacy events. This report will be configured as an automation rule.

  1. Go to Management > Reports.

  2. Select Add > Add Filter-based Report. Name the report Legacy Events.

  3. In Item type, select Events (Historical), then press Save and Close.

  4. To create an automation rule for legacy events, go to the Automation Rules module and select Add.

  5. Name the rule. Next to Trigger, select New.

  6. In Type drop-down, select Periodic.

  7. In Interval, select Monthly. Define the Day of month and Time of day that the report should run, then press OK.

  8. From the Action field, select Add, select Report, then press OK.

  9. Select Choose, then select the Legacy Events report.

  10. Press OK, then press Save and Close.

  11. Press Save and Close.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.