Getting file Details with find -mmin


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting file Details with find -mmin
# 1  
Old 09-04-2013
Getting file Details with find -mmin

I'm new to this and I have done a lot of research and am 99% done with my ksh script BUT I need help with. The script looks at Journal files and reports back on any that have not been updated for 15 min. Everything works but I wanted more detail (added -ls) and now I'm getting dups.
Original code:
Code:
find $journdir2*.dat -mmin +15 ! \( -name "*MFN*.dat" -o -name "*Hybrid*.dat" -o -name "*FileGet*.dat" -o -name "Error*.dat" \) -exec echo {} \; > $logfile

returns :/jcap/EngineJournal/journal_09032013/From_Halfpenny_Hub_Order_09032013.dat
Code with "-ls":
Code:
find $journdir2*.dat -mmin +15 ! \( -name "*MFN*.dat" -o -name "*Hybrid*.dat" -o -name "*FileGet*.dat" -o -name "Error*.dat" \) -ls -exec echo {} \; > $logfile


Returns:
99585 460 -rw-r--r-- 1 jcap jcap 470202 Sep 3 16:40 /jcap/EngineJournal/journal_09032013/From_Halfpenny_Hub_Order_09032013.dat
/jcap/EngineJournal/journal_09032013/From_Halfpenny_Hub_Order_09032013.dat

Is it possible to elim. the dup and keep the detail with this code? Thank you
# 2  
Old 09-04-2013
remove -exec echo {} \; from your code
This User Gave Thanks to Subbeh For This Post:
# 3  
Old 09-04-2013
wow..A million thanks.. It worked!..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find command mmin

Hi, Please tell me what the below command wil do, according to my understanding it finds files in the current and sub directories whose modification time is 5 hrs and it dont zip the already zipped files who's size is more than 4K. Am I Correct? find . -type f -mmin +300 ! -name... (1 Reply)
Discussion started by: nag_sathi
1 Replies

2. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

3. Shell Programming and Scripting

Find mmin, mtime, cmin not working

Dear All, We are having the script which is creating the folder on another server if it is not present using ssh. Using scp it copies copy all pdf files from local folder to server folder. After all copy is done, Just to verify i was using the below find command find... (3 Replies)
Discussion started by: yadavricky
3 Replies

4. Shell Programming and Scripting

-$arg not working for find mmin

Hi, I want to parameterise the argument for 'mmin' to find out files created/edited 'n' minutes ago. For this i have written something as simple as the following: n=10 m=-1 c=expr $n \* $m #value comes to -10 when echoed find -mmin -10 #works find -mmin $c #doesnt work ... (5 Replies)
Discussion started by: SheetalN
5 Replies

5. Shell Programming and Scripting

Help with find –mmin in a .ksh script

I need to compare the time a file was last modified against current time and conditionally proceed. At the command prompt I can do: find MYFILE -mmin +1140 and it lists the file. But I need to test, and if true do something I’ve tried things like: if ; then if ; then etc. ... (2 Replies)
Discussion started by: tlavoie
2 Replies

6. Shell Programming and Scripting

unix find command without mmin option

I need to check if a file has been modified within the last x hours. My find command does not have the mmin option -- only the mtime option which is in 24 hour perriods (1 Reply)
Discussion started by: Bill Ma
1 Replies

7. Solaris

Any alternative of find . -mmin 20

hi find command is not working with -mmin in Solaris Os. Do we hav any alternative to find the modified file in any specified time span ( suppose in last 1- 2 hours) Thanks (2 Replies)
Discussion started by: Prat007
2 Replies

8. HP-UX

find command using -mmin param

Hi Everyone, I would like to know how to find a file which was created in the period of 20+ hours, in most common unix OS, the parameter -mmin is not supported (i.e, HP-UX, Solaris, LInux, AIX) Could you help on this ?? (3 Replies)
Discussion started by: jmbeltran
3 Replies

9. UNIX for Dummies Questions & Answers

no [find -mmin -1]

I wanna show all files like...one minute old, one hour old, five hours old and so on... in my OS (HP-UX) there's only the command .. find -name "..." -mtime -n but this is only for days, there isn't something like -mmin -n ...just don't know what to do. also the newer than option isn't... (3 Replies)
Discussion started by: svennie
3 Replies
Login or Register to Ask a Question