Help needed with find command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help needed with find command
# 1  
Old 04-19-2010
Help needed with find command

Hi,

I'm a complete noobie at UNIX and have hit a problem.
I'm using the 'Talend' ETL tool to try and extract flat files from UNIX on a weekly basis.
The dates are maintained in a control table and the appropriate folder has been mounted.

I am using a component in 'Talend' which enable you to write a UNIX script to do this (I've been told this is the best approach!?).
So far I'm trying to use 'find' and access a folder which is held in context to get the files which are between EXTRACT_START_DATE and EXTRACT_END_DATE like this -

Code:
"find ./" + context.Dir_Data_Load_Files + "/ \ -mtime -" + String.valueOf((((new Date()).getTime()+(1000 * 60 * 60 * 24)-TalendDate.parseDate("yyyy-MM-dd", System.getProperty(jobName+"_EXTRACT_START_DATE")).getTime())/(1000 * 60 * 60 * 24))) + "\ -mtime +" + String.valueOf((((new Date()).getTime()-(1000 * 60 * 60 * 24)-TalendDate.parseDate("yyyy-MM-dd", System.getProperty(jobName+"_EXTRACT_END_DATE")).getTime()) /(1000 * 60 * 60 * 24))) + " -print"

The tool tells me that the find command is in an incorrect format.

Can anyone shed any light on this for me please?

Thanks

Last edited by vbe; 04-19-2010 at 11:03 AM..
# 2  
Old 04-19-2010
Say you want a start of 15 Apr 2010 and an end of 20 Apr 2010
Code:
touch -t 201004150000 dummy1
touch -t 201004202359 dummy2
find /path -type f  \( -newer dummy1  -a ! -newer dummy2 \)

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help needed - find command for recursive search

Hi All I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please? E.g of the problem. The directory A is having sub directory which are having subdirectory an so on. I need a command which will find the... (2 Replies)
Discussion started by: sudeep.id
2 Replies

2. Shell Programming and Scripting

Help needed with find command

Hi! hi I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues. Here what I tried. Script will take input from user say 1_abc.txt, find the file and print... (6 Replies)
Discussion started by: sukhdip
6 Replies

3. UNIX for Dummies Questions & Answers

find with prune option help needed

Hello, I am using ksh93 (/usr/dt/bin/dtksh) on Solaris and am stuck when trying to use find with the -prune option. I need to search a directory (supplied in a variable) for files matching a certain pattern, but ignore any sub-directories. I have tried: find ${full_path_to_dir_to_search}... (9 Replies)
Discussion started by: gary_w
9 Replies

4. UNIX for Dummies Questions & Answers

find/mail help needed

so I saved a mail message of mine to a new dir/file My question is how do I find the path to my file containing my saved email from my home dir prompt in unix? Thanks. (1 Reply)
Discussion started by: drew211
1 Replies

5. UNIX for Dummies Questions & Answers

Help needed with find command

Hi Guys, Can someone help with this. I have to find out a file name which calls the following sql script "abhishek_to_sdw.sql". In other words it contains a pattern like "abhishek_to_sdw.sql". I have found out using "find" command that the file abhishek_to_sdw.sql is existing on the... (4 Replies)
Discussion started by: max29583
4 Replies

6. Shell Programming and Scripting

find explantion needed

Dear Experts, please can any body help me to explain the below commants in detail what exactly its doing what we mean by -mtime +2 and -exec and rm{}; find /home/data/ab.200* -mtime +2 -exec rm {} \; Regards, SHARY (3 Replies)
Discussion started by: shary
3 Replies

7. UNIX for Dummies Questions & Answers

FIND and REMOVE HELP NEEDED!!!

Hello, I am aware of that Find command finds certain files and remove command removes certain files. However, is there a way to Find certain DIRECTORY and remove that DIRECTORY? thank you (3 Replies)
Discussion started by: scooter17
3 Replies

8. UNIX for Dummies Questions & Answers

Find and Remove help needed!!!!

thank you for the help. (1 Reply)
Discussion started by: scooter17
1 Replies

9. UNIX for Dummies Questions & Answers

Find and Replace code help needed

I have a file "dbshot.xml" that contains lines that need replacing in a batch format but the parameters are based on two lines. Ex. <role roletype="01"> <status>1 needs to be changed to <role roletype="01"> <status>0 I can't use simply "<status>1" replace since the... (2 Replies)
Discussion started by: E Orgill
2 Replies

10. UNIX for Advanced & Expert Users

help on find with chmod.. urgent help needed

Hello to all Unix gurus.. I am writing a generic script which takes the options of unix command as input and concatenate all the pieces and forms a complete executable command. I am getting an error with the following command as I am resetting my own permission on the root directory. When the... (4 Replies)
Discussion started by: sdlayeeq
4 Replies
Login or Register to Ask a Question