Need Help with Pipeline Script

I want to create a Jenkins pipeline , which can access my PV in Openshift cluster and delete a specific directory.
So we are using Sonarqube and they create Elastic Search Index which needs to delete manually after we restart or create Sonarqube Pod.
So to do task Automatically , i need to create a Pipeline which can access the Volume where Index has been created and Delete the Directory.
Any suggestions ?
Help me creating the Script for it .