Nexus3 - Cleanup Script, creating a report from what was removed

I have asked this question to the support and figured I would ask here as well.

Is there a way to create a report of what is being removed from the running of the cleanup script?

Was hoping someone had been asked to do something like this and I wasn’t going to be a guinea pig.

As of 3.17, there is no simple log that will list what was marked as deleted for a given instance of a scheduled task or cleanup policy run.

A few options:

  • The task will have a log that contains a summary of what was removed. The logs will be located at “sonatype-work/nexus3/log/tasks/” by default
  • You can, and should, preview the result of your policy before running the cleanup. This is built into the Cleanup Policy UI. See a screenshot at Cleanup Policies
  • If you have an application capable of receiving Webhooks, you can configure Nexus to emit a webhook when a file is deleted. While this will include “normal” file delete requests, you would see a spike of file deletions while the task is running, so you can get an idea of what the task is doing: Example Headers And Payloads