KB-2297 How to use logsv2 inside the Cleanup Script

Purpose

For data maintenance, the cleanup script can be run to move logs and process archives to a backup location and remove the old ones from the server. This script has been updated to account for Tomcat logs with the logsv2 option. 

Logs that are cleaned up when using the logsv2 option include the following:

  • Tomcat
  • Engine Performance
  • Removed Processes 
  • Logins
  • Engine Calls
  • Expressions Performance

Instructions

To run the Cleanup Script, follow the steps in the documentationBelow are example use cases of the logsv2 option:

To move files to a backup directory and keep the five most recent versions of log files, run the following:

<APPIAN_HOME>/server/_scripts/cleanup.sh logsv2 -target <Backup_Location> -keep 5

To delete files and keep the 30 most recent versions of log files, run the following: 

<APPIAN_HOME>/server/_scripts/cleanup.sh logsv2 -delete -keep 30

To run the debug flag with the cleanup script, run the following: 

<APPIAN_HOME>/server/_scripts/cleanup.sh logsv2 -target <Backup_Location> -keep 30 -debug

Note: The -debug flag enables debugging information helpful for troubleshooting. 

Additionally, the -logDir flag can be used to point to a different log directory rather than the default logs folder.

Affected Versions

This article applies to all self-managed versions of classic Appian.

Last Reviewed: March 2024

Related
Recommended