import jenkins.model.Jenkins
import static groovy.io.FileType.*
import hudson.EnvVars
def jenkins = Jenkins.getInstanceOrNull()
EnvVars envVars = build.getEnvironment(listener);
def workspace = envVars.get('WORKSPACE')
println "WKS: $workspace"
println "Backup the pom.xml file"
def src = new File("$workspace/pom.xml")
def dst = new File("$workspace/pom.xml.bak")
Question: Should I find the Node/Agent where the code is running ?