Last update:
Last verified version: AMC 3.2.1
This article explains how to safely identify and delete old scan result files from the ASGARD Management Center using the find command.
Identifying Old Files
To find files older than a certain number of days, use this command:
sudo find /var/lib/asgard-management-center/scan-results/ -type f -mtime +180
This finds all files that haven't been changed in more than 180 days. You can change the number to match how long you want to keep files.
Testing Before You Delete
Always test your command before deleting anything. Use this safe version:
sudo find /var/lib/asgard-management-center/scan-results/ -type f -mtime +180 -exec echo rm {} \;
The echo part is important, as it shows you a list of files that would be deleted without actually deleting them. Review this list to make sure it's correct.
Deleting the Files
After you've checked the list and everything looks right, remove echo to delete the files:
sudo find /var/lib/asgard-management-center/scan-results/ -type f -mtime +180 -exec rm {} \;
This permanently deletes files. Make sure you've tested first and have backups if needed.
What to Back Up
You only need to back up the .txt.gz files in most cases. The other files are:
-
.json.gzfiles: THOR logs in JSON format (if enabled) -
.html.gzfiles: HTML reports
The text logs (.txt.gz) contain everything you need to keep your information and reload data into the Analysis Cockpit later.