The purge.sh script either archives or purges processed access log files which are stored in the /opt/pingidentity/dashboard/logs directory.

Note: When the purge script is run, the log files are permanently deleted from the /opt/pingidentity/dashboard/logs directory. Always backup the files before deleting.

Located in the /opt/pingidentity/dashboard/util directory, the purge script deletes logs older than the specified number of days. Run the script using the Dashboard command line.

Note: The number of days specified should be between 1-365 days.

For example.

/opt/pingidentity/dashboard/util/purge.sh -d 3
In the above example, purge.sh deletes all access log files older than 3 days. Here is sample output.
/opt/pingidentity/dashboard/util/purge.sh -d 3
This will delete the data in /opt/pingidentity/dashboard/logs which is older than 3 days.
Are you sure (yes/no): yes
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-07 : last changed at Sat Feb  9 00:29:43 EST 2019
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-09 : last changed at Mon Feb 11 00:29:48 EST 2019
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-08 : last changed at Sun Feb 10 00:29:56 EST 2019
Done.

Force delete: You can force delete the Dashboard log files by using the -f option with the purge.sh script. When using this option, the script does not check for confirmation to purge the log files. Use the force purge option with the -d option to provide the number of days of logs to keep.

Example: The following snippet shows an example of the force purge and -d option.

/opt/pingidentity/dashboard/util/purge.sh -d 3 -f
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-07 : last changed at Sat Feb  9 00:31:26 EST 2019
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-09 : last changed at Mon Feb 11 00:31:30 EST 2019
removing /opt/pingidentity/dashboard/logs/dashboard.log.2019-02-08 : last changed at Sun Feb 10 00:31:35 EST 2019
Done.
In the above example, the script force purges the Dashboard log files while keeping log files of 3-days.

External log archival

The purge script can also archive logs older than the specified number of days to secondary storage. Use the -l option and include the path of the secondary storage to archive log files. For example:

/opt/pingidentity/dashboard/util/purge.sh -d 3 -l /tmp/

In the above example, log files older than 3-days are archived to the tmp directory. To automate log archival, add the script to a cron job.