Create Maintenance Plan

Create Maintenance Plan

To keep AMPS running smoothly, 60East recommends developing a maintenance plan, and creating an action configuration to implement the maintenance plan.

AMPS actions provide a way for the server to perform specific tasks in response to specific events. The most common use for actions is to create a maintenance schedule, as described below.

Details on AMPS actions are provided in the Automating AMPS with Actions section of the AMPS User Guide. Configuration for Actions are described in the Actions section of the AMPS Configuration Guide.

The following table describes maintenance for various features of AMPS. If your installation of AMPS doesn't use a given feature, there is no need to have a maintenance plan for that feature.

60East recommends that you consider the following maintenance actions, and whether they are appropriate for your installation:

Example Maintenance Plan

For example, the following maintenance plan runs each day, at 23:00 (11 PM local time).

The plan performs the following maintenance:

  • Archives journal files older than three days

  • Removes journal files older than 14 days

  • Truncates statistics to keep the last 7 days of statistics

  • Removes log files in the $AMPS_ADMIN/logs directory that are older than 7 days, and

  • Removes any records in the Orders topic in the SOW that have a status of canceled that have not been updated in the last two days.

    There are a few important points to notice in the filter used to remove records from the Orders topic:

    • Since the timestamps have a unit of seconds, the Filter describes 48 hours as 172800 seconds (60 seconds in a minute * 60 minutes in an hour * 48 hours).

    • Since the configuration file is in XML format, the Filter uses the XML escape for the < symbol (&lt;). This is translated into a < symbol when the configuration file is parsed.

    • Within an action, AMPS replaces the token {{AMPS_UNIX_TIMESTAMP}} with the point in time that the action begins running. We can use this to create a Filter that uses the correct value no matter when the filter is run.

<Actions>
   <Action>
     <On>
       <Module>amps-action-on-schedule</Module>
       <Options>
         <Name>Nightly maintenance</Name>
         <Every>23:00</Every>
       </Options>
    </On>

    <!-- Archive journals older than three days -->
    <Do>
      <Module>amps-action-do-archive-journal</Module>
      <Options>
         <Age>3d</Age>
      </Options>
    </Do>

    <!-- Remove journals older than 14 days -->
    <Do>
      <Module>amps-action-do-remove-journal</Module>
      <Options>
        <Age>14d</Age>
      </Options>
    </Do>

    <!-- Remove statistics older than 7 days -->
    <Do>
      <Module>amps-action-do-truncate-statistics</Module>
      <Options>
        <Age>7d</Age>
      </Options>
    </Do>

    <!-- Remove event logs that are older than
         seven days. -->

    <Do>
       <Module>amps-action-do-delete-files</Module>
       <Options>
           <Pattern>${AMPS_ADMIN}/logs/*.log</Pattern>
           <Age>7d</Age>
       </Options>
    </Do>

    <!-- Remove records from the Orders topic in the SOW
         that are canceled and have not been updated
         in two days -->
    <Do>
       <Module>amps-action-do-delete-sow</Module>
       <Options>
           <Topic>Orders</Topic>
           <MessageType>json</MessageType>
           <Filter>/status = 'canceled'
                   AND LAST_UPDATED() &lt; ({{AMPS_UNIX_TIMESTAMP}} - 172800) </Filter>
       </Options>
    </Do>
   </Action>
</Actions>

Last updated

Copyright 2013-2024 60East Technologies, Inc.