Amazon EC2 - Quartz and Job not running at correct time

Damien

I have a java app deployed on an Amazon EC2 server. I use quartz for scheduling various jobs.

I tried scheduling a job to run at 9am - I noticed it didnt execute until 10am I then tried to execute a job at 9am GMT-5 -should of executed at 2pm GMT but it actually executed at 3pm GMT

On further analysis i noticed the time on my Amazon server was set in UTC and is an hour behind GMT currently

I was just wondering - what part of my setup is not currently correct since the jobs are not executing at the correct time?

Do I need to specify anything when setting the cron trigger? I am setting up the Cron in quartz as follows using the CronScheduleBuilder

    CronExpression cronExpression = new CronExpression(cronValue);
    TimeZone timeZone = TimeZone.getTimeZone("Etc/GMT-5");
     cronExpression.setTimeZone(timeZone);

     Trigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerName).startNow()
                .withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)).build();

        JobDetail job = JobBuilder.newJob(MyCloudTasksServerTaskExecutor.class).withIdentity(taskId.toString())
                .storeDurably(true).build();

Any help is greatly appreciated

Uwe Plonus

As you wrote the EC2 server is running with UTC. GMT changed at the last Sunday of March from standard time to daylight saving time.

I would suggest to time all your jobs in UTC. Then the start time of the job is different in summer and winter. You have to decide if this is OK for you.

Else you have to create two timers, one running from March to October and the other from October to March which differ in one hour.

It is also logical that the EC2 instances run with UTC because then a shift across time zones is easier to achieve.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Amazon EC2 - Quartz and Job not running at correct time

From Dev

Correct usage of describeInstances amazon ec2

From Dev

Keep meteor running on amazon EC2

From Dev

Running websocket server on amazon EC2

From Dev

Quartz scheduler not running the cron job

From Dev

Unable to setup cron-job on Amazon EC2

From Dev

How To Manage Meteor App Running On AWS AMAZON EC2

From Dev

Connect Remotely to mysql running on a Amazon EC2 Instance

From Dev

Running a simple HTTPS Node JS Server on Amazon EC2

From Dev

Opening a Web UI for a service running on Amazon EC2?

From Dev

How to check whether Quartz cron job is running?

From Dev

How to prevent quartz job multiple running

From Dev

How to submit long time jobs on Amazon EC2?

From Dev

Postgres create/restore taking lot of time on amazon ec2

From Dev

Query Amazon EC2 instance AMI creation date/time

From Dev

it is possible in quartz to configure a job on one server and running that job on another server?

From Dev

it is possible in quartz to configure a job on one server and running that job on another server?

From Dev

Amazon SQS, Boto, and Python: Fetching and Running a Script on Amazon EC2

From Dev

Amazon SQS, Boto, and Python: Fetching and Running a Script on Amazon EC2

From Dev

Execute a CI controller function via Amazon ec2 cron job

From Dev

Running time of a job sent to a ExecutorService

From Dev

Adding time to a running slurm job

From Dev

Running time of a job sent to a ExecutorService

From Dev

Getting data from a running job in Quartz.net

From Dev

Quartz.NET Running Job Self-Reschedule?

From Dev

Quartz.net error when running job with ADOStore

From Dev

Same quartz job running twice because of two server instances

From Dev

How to check hive query running on amazon EMR or EC2 after getting disconnected from client

From Dev

ImportError: No module named pkg_resources when running pip on Amazon EC2

Related Related

  1. 1

    Amazon EC2 - Quartz and Job not running at correct time

  2. 2

    Correct usage of describeInstances amazon ec2

  3. 3

    Keep meteor running on amazon EC2

  4. 4

    Running websocket server on amazon EC2

  5. 5

    Quartz scheduler not running the cron job

  6. 6

    Unable to setup cron-job on Amazon EC2

  7. 7

    How To Manage Meteor App Running On AWS AMAZON EC2

  8. 8

    Connect Remotely to mysql running on a Amazon EC2 Instance

  9. 9

    Running a simple HTTPS Node JS Server on Amazon EC2

  10. 10

    Opening a Web UI for a service running on Amazon EC2?

  11. 11

    How to check whether Quartz cron job is running?

  12. 12

    How to prevent quartz job multiple running

  13. 13

    How to submit long time jobs on Amazon EC2?

  14. 14

    Postgres create/restore taking lot of time on amazon ec2

  15. 15

    Query Amazon EC2 instance AMI creation date/time

  16. 16

    it is possible in quartz to configure a job on one server and running that job on another server?

  17. 17

    it is possible in quartz to configure a job on one server and running that job on another server?

  18. 18

    Amazon SQS, Boto, and Python: Fetching and Running a Script on Amazon EC2

  19. 19

    Amazon SQS, Boto, and Python: Fetching and Running a Script on Amazon EC2

  20. 20

    Execute a CI controller function via Amazon ec2 cron job

  21. 21

    Running time of a job sent to a ExecutorService

  22. 22

    Adding time to a running slurm job

  23. 23

    Running time of a job sent to a ExecutorService

  24. 24

    Getting data from a running job in Quartz.net

  25. 25

    Quartz.NET Running Job Self-Reschedule?

  26. 26

    Quartz.net error when running job with ADOStore

  27. 27

    Same quartz job running twice because of two server instances

  28. 28

    How to check hive query running on amazon EMR or EC2 after getting disconnected from client

  29. 29

    ImportError: No module named pkg_resources when running pip on Amazon EC2

HotTag

Archive