Configuring log purging

The data purging values for logtokeep, logtodelete, and datatodelete are automatically configured during IVG installation in the install_ivg.cfg file, and log to /export/home/<linux user>/9.6/purgelog/logmgr.log.MMDDYYYY. Adjust these values post-installation by manually modifying the the logmgr_expire.sh script located at /export/home/<linux user>/9.6.

Note:

We recommend keeping log data only as long as it is needed. If reports for a specific time period are required, VHT best practices also recommend that these reports be run, exported to CSV files, and the supporting data purged or moved to a data warehouse.

Replacing the logmgr_expire.sh script

Replace the existing logmgr_expire.sh script with the attached logmgr-IVG35_and_above.zip file. By default, the script is located at /export/home/postgres-vht/9.6.

Update logtokeep and logtodelete

The values for logtokeep and logtodelete establish a range of how many days PostgreSQL database log records are kept.

  • logtokeep - This value determines the maximum number of days PostgreSQL database log records are kept.
  • logtodelete - PostgreSQL database log records up to this value (in days) are deleted.

For example, if the value for logtokeep is 10 and the value for logtodelete is 30, then the PostgreSQL database logs that fall between 11 - 30 days old will be deleted.

To update the values for logtokeep or logtodelete:

  • Edit the /var/spool/cron/<PostgreSQL Linux user> file as a root user using a Linux text editor:
  • Locate the following line:
00 3 * /bin/sh /export/home/<linux user>/9.6/logmgr_expire.sh holly holly holly12 10 30 postgres >> /dev/null 2>&1
  • The fields for logtokeep and logtodelete are expressed as integers with the default values 10 and 30, respectively. Modify the fields with the required values.
FieldDescriptionDefault Value
logmgr_expirelogtokeep

Maximum number of days postgreSQL database log records are kept.

This is the value set during installation in the install_ivg.cfg file.

10
logtodelete

PostgreSQL database log records up to this value (in days) are deleted.

This value is set during installation in the install_ivg.cfg file.

30
  • Save the file.
  • Restart the Cron service for these changes to take effect.

Update datatodelete

The datalog_expire.sh script cleans up old data. The value for datatodelete determines how long (in days) to keep data files inside the call data directory structure. Data files older than the datatodelete value are deleted.

To update the values for datatodelete:

  • Edit the /var/spool/cron/<Holly Linux user> file as a root user using a Linux text editor:
  • Locate the following line:
00 4 * * * /bin/sh  /export/home/holly/bin/datalog_expire.sh 10 >> /dev/null 2>$
  • The value following datalog_expire.sh is the integer value for the number of days of data to keep, and is set to 10 by default. Update this value with the maximum age (in days) of data to keep.
  • Save the file.
  • Restart the Cron service for these changes to take effect.