Skip to end of banner
Go to start of banner

Script - cleanup groovy temporary files

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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 (smile).

{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}
  • No labels