i want check whether the file is exist or not, In HDFS location using oozie batch.
in my HDFS location , in daily base I will get file like "test_08_01_2016.csv","test_08_02_2016.csv" at every day 11PM.
So i want check whether the file exist are after 11.15 PM ,i can check file exist on not using decision node. by using below workflow .
<workflow-app name="HIVECoWorkflow" xmlns="uri:oozie:workflow:0.5">
<start to="CheckFile"/>
<decision name="CheckFile">
<switch>
<case to="nextOozieTask">
${fs:exists("/user/cloudera/file/input/test_08_01_2016.csv")}
</case>
<default to="MailActionFileMissing" />
</switch>
<action name="MailActionFileMissing" cred="hive2">
<hive2 xmlns="uri:oozie:hive2-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<jdbc-url>jdbc:hive2://quickstart.cloudera:10000/default</jdbc-url>
<script>/user/cloudera/email/select.hql</script>
<file>/user/cloudera/hive-site.xml</file>
</hive2>
<ok to="End"/>
<error to="Kill"/>
</action>
<action name="nextOozieTask" cred="hive2">
<hive2 xmlns="uri:oozie:hive2-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<jdbc-url>jdbc:hive2://quickstart.cloudera:10000/default</jdbc-url>
<script>/user/cloudera/email/select1.hql</script>
<file>/user/cloudera/hive-site.xml</file>
</hive2>
<ok to="End"/>
<error to="Kill"/>
</action>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="End"/>
but i want to get file name dynamically like for example
" filenamt_todaysdate i.e test_08_01_2016.csv
".
please help me on this how can i get filename dynamical.
thanks in advance.