Oozie coordinator with sysdate as start time
Asked Answered
H

1

5

I want to run oozie coordinator with start time as sysdate. How do I do that?
is it possible to put sysdate as start date ? Will it catch up?

Huntlee answered 3/12, 2014 at 3:5 Comment(0)
B
18

You can make coorodinator's "start" refer to a variable - startTime, then overwrite its value with sysdate from command line, such as:

 oozie job -run -config ./coord.properties -DstartTime=`date -u "+%Y-%m-%dT%H:00Z"`

adjust the time format if you are not using UTC time zone in your system.

sample coordinator job xml:

<coordinator-app name="my-coord"                               
    frequency="${frequency}" start="${startTime}" end="${end}" timezone="UTC" 
    xmlns="uri:oozie:coordinator:0.4">                                    
    <action>                                                              
            <workflow> ...                                                   

coordinator attribute file coord.properties:

...
startTime=2014-05-19T22:00Z 
end=2015-01-19T22:08Z   
frequency=60 ...
Buckshot answered 6/12, 2014 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.