Script to cleanup temporary groovy files . The Groovy and Gant macros produce temporary groovy class files in the script/temp/groovy directory in the Confluence home directory. These should be deleted occasionally. It also serves as an example of the gant macro .
{gant} target(default: "Default target") { yesterday = System.currentTimeMillis() - 24*3600*1000 // 24h x 3600 secs/hr x 1000 for milliseconds tempDirectory = "${confluenceHome}/script/temp/groovy" // temp file location println "Cleanup of files in ${tempDirectory}" ant.delete { fileset(dir: tempDirectory) { date(millis: yesterday, when: "before") } } } {gant}