By default, the number of days for data purge is configured as 180 days for MongoDB and 365 days for PostgreSQL databases. You can modify the default number of days.

About this task

By default, vRealize Business for Cloud includes two scripts that are scheduled every Sunday. The scripts purge certain database tables from the MongoDB and PostgreSQL databases. The number of days is used to specify the age of the data in the tables. Any data that is older than the specified time duration is purged by the scripts.

Prerequisites

Procedure

  1. Log in to SSH with the root user credentials.

    If you are using the Windows platform, log in to SSH using a Windows SSH tool. For example, Putty.

  2. Navigate to the /usr/ITFM-Cloud/va-tools/bin folder.

    For example, cd /usr/ITFM-Cloud/va-tools/bin

  3. Edit theservices-maintenance.sh script.
    1. Open the script:
      #!/bin/bash
      exec &> /var/log/vrb/serviceMainteneace.log
      # Script to purge data before specified number of days; Default considered for Mongo is 6 months and for Postgres it is 1 year.
      . /usr/ITFM-Cloud/va-tools/bin/mongopurge.sh 180
      . /usr/ITFM-Cloud/va-tools/bin/postgrespurge.sh 365
      #restart mongo db
      monit restart mongo
      #restart itbm-server
      monit restart itbm-server

      The default number of days specified in the script for:

      • mongopurge.sh is 180.

      • postgrespurge.sh is 365.

    2. Change the number of days for mongopurge.sh and postgrespurge.sh, as required.