Oozie coordinator with sysdate as start time

江枫思渺然 提交于 2019-12-07 08:21:46

问题


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?


回答1:


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 ...


来源:https://stackoverflow.com/questions/27262938/oozie-coordinator-with-sysdate-as-start-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!