Search code examples
hadoopoozie

Find time of last execution of workflow in oozie


I have a workflow with a sub workflow. The "main" workflow checks the filesize of a dir and if size is bigger than a trigger value, the sub workflow is started.

Now I need an additional trigger: the time from the current execution of main workflow and the timestamp of the last execution of subworkflow. At the moment I only see the possibility of writing a timestamp in hdfs file or hive table or mangling the output of oozie commmand line interface.

Does anybody know an more elegant way to solve this within the oozie workflow or property files ?


Solution

  • Since I did not find any more elegant solution, I am using this as a solution: oozie jobs -oozie ${OOZIE_HOST}/oozie -localtime -len 1 -filter name=${WORKFLOW} | grep ${WORKFLOW} | rev | cut -c -25 | rev | sed -e 's/[^0-9]//g'.. If anything goes wrong or workflow is not found result is null, which is ok the moment