View Full Version : Grails Cron Job Issue

01-02-2011, 12:10 AM

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")

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

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'