If you need more flexibility than just a timer, you can use Quartz Plugin and configure the Cron job:
class MyTimerJob { static triggers = {
To start Quartz when the application starts (as Jared said: not when tomcat starts), make sure your grails-app/conf/QuartzConfig.groovy has the following:
quartz { autoStartup = true }
autoStartup = true by default, so you probably won't need to change anything.
Using this plugin will save you from having to execute timer logic yourself.
source share