---
title: Purge log files
description: To manage storage space, you can either archive or purge access log, controller log, and audit log files that have been uploaded to ABS. ASE provides a purge.sh script to remove access log files from the abs_uploaded directory. The purge script is part of the /opt/pingidentity/ase/util directory.
component: pingintelligence
version: 5.1
page_id: pingintelligence:api_security_enforcer:pingintelligence_purge_log_files
canonical_url: https://docs.pingidentity.com/pingintelligence/5.1/api_security_enforcer/pingintelligence_purge_log_files.html
revdate: March 28, 2024
section_ids:
  external-log-archival: External log archival
  related-links: Related links
---

# Purge log files

To manage storage space, you can either archive or purge access log, controller log, and audit log files that have been uploaded to ABS. ASE provides a `purge.sh` script to remove access log files from the `abs_uploaded` directory. The `purge` script is part of the `/opt/pingidentity/ase/util` directory.

|   |                                                                                      |
| - | ------------------------------------------------------------------------------------ |
|   | When the purge script is run, the access log files are permanently deleted from ASE. |

To run the purge script, enter the following in ASE command line:

```
/opt/pingidentity/ase/util/purge.sh -d 3
In the above example, purge.sh deletes all the access log files which are older than 3 days. Here is a sample output for the purge script.
admin@pingidentity# ./util/purge.sh -d 3
This will delete logs in /opt/pingidentity/ase/logs/abs_uploaded that is older than 3 days.
Are you sure (yes/no): yes
removing /opt/pingidentity/ase/logs/abs_uploaded/Processed_decoy_pid_278892017-04-01_11-04.log.gz : last changed at Sat Apr 1 11:11:01 IST 2017
removing /opt/pingidentity/ase/logs/abs_uploaded/Processed_http_ws_80_pid_27905access__2017-04-01_11-04.log.gz : last changed at Sat Apr 1 11:11:01 IST 2017
```

## External log archival

The `purge` script can also archive logs to secondary storage for future reference. The purge script provides an option to choose the number of days to archive the log files. Use the `-l` option and the path of the secondary storage to place the archived log files. For example:

```
admin@pingidentity# ./util/purge.sh -d 3 -l /tmp/
```

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

## Related links

* [Change management log levels](pingintelligence_changing_management_log_levels.html)

* [ASE management, access and audit logs](pingintelligence_ase_acess_management_audit_logs.html)

* [Configure syslog](pingintelligence_configuring_syslog_server.html)
