Please direct future questions to the oozie mailing list instead of to me
directly.

How are you determining that the files are older than 5 days?  If you're
checking the timestamp of the file, then you'll have to use either the
Shell action or the Java action to get the timestamp; you can then either
take care of the deleting logic in the same action or use the decision node
to an FS action.  If you don't want to do any of that, can you re-working
whatever is generating those files to have a directory structure that
indicates the time it was created?  For example, 2013/07/16/14/file.txt
could be interpreted as having been created at 2pm on July 16 2013.  You
can then use variables in your workflow to parameterize it, similar to
wildcards.  With my previous example,
${YEAR}/${MONTH}/${DAY}/${HOUR}/file.txt and when you start the workflow,
you can set those variables to 5 days ago from when the workflow is
started.

To make the workflow run every hour, you can use a coordinator job.  In
fact, you can have the coordinator check for the file pattern I gave above
and the workflow would simply do the FS action to delete it.  I suggest you
take a look at
http://oozie.apache.org/docs/3.3.2/CoordinatorFunctionalSpec.html which
describes (with many examples) how to create a coordinator job.

- Robert



---------- Forwarded message ----------
From: KHATHUTSHELO PRINCE <[email protected]>
Date: Tue, Jul 16, 2013 at 6:49 AM
Subject: oozie Fs problem
To: [email protected]


hi,

i have create oozie workflow to move files from one directory to another in
hdfs. i use oozie action FS but the idea is that  i want the process to
repeat every hour and delete files that are older than 5 day.

but the problem is i can not use wild cards in oozie Fs and i don't know
shell scripting. Can you please help me.




Regards
 Prince

Reply via email to