PDA

View Full Version : Grails Cron Job Issue



fitztho
01-02-2011, 12:10 AM
Hello,

I am working with the following setup:

Ubuntu 10.04 Server with Tomcat6 and Apache2

Grails 1.3.3

I have the following job defined:




class ImportUsersJob {
def userDataService

static triggers = {
cron name: 'myTrigger', cronExpression: "45 6 * * * ?"

}
def execute() {
println("Job executed")
userDataService.updateUsers()
}
}

The issue is this: the job is not running at all. Is there some configuration that I am missing?

khumbert
31-03-2011, 05:50 AM
Your cron expression seems to be saying "Run every hour at 6 minutes 45 seconds." Is that correct?

Are you running this in the test environment? By default, jobs will not be executed when running under the test environment.

Any errors in the error.log? You can also enable debugging by putting the following in your log4j configuration:
debug 'grails.app.task'