Skip to content

Migrate cron expression to another timezone #243

@jmrozanec

Description

@jmrozanec

I need something like below:

newCronExpression = convert (localCronExpresn,fromLocalTZ, "UTC")

Is it possible using cron-utils?

Let me give an example:

My local timezone is IST i.e. GMT+5.30.

Current local time is: 11:20 AM.

I want a job to run in 45 min of every hour.

So, my cron expression: 45 * * * *

Hence I am expecting my job to run after 25 min ( as starting time is 11:45 AM)

but my job is running as per UTC, because of oozie.

Current time in UTC : 05:50 AM

As per cron expression 45 * * * , the starting time will be 06:45 AM at GMT.

So, the job will be actually started after 55 min.

Expected : After 25 min

Actual : After 55 min

So,

if I am converting my local cron expression 45 ** * * to 15 * * * * at GMT, then actual waiting period will be same as expected.

This feature was originally reported at cron-utils-examples by @jrphub

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions