Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Getting file Details with find -mmin

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-04-2013
blackopz blackopz is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 16 September 2013, 10:09 AM EDT
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old Unix and Linux 09-04-2013
Subbeh Subbeh is offline
Registered User
 
Join Date: May 2011
Last Activity: 27 January 2015, 8:40 AM EST
Posts: 330
Thanks: 36
Thanked 86 Times in 85 Posts
remove -exec echo {} \; from your code
The Following User Says Thank You to Subbeh For This Useful Post:
blackopz (09-04-2013)
Sponsored Links
    #3  
Old Unix and Linux 09-04-2013
blackopz blackopz is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 16 September 2013, 10:09 AM EDT
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
wow..A million thanks.. It worked!..
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
-$arg not working for find mmin SheetalN Shell Programming and Scripting 5 03-22-2012 03:56 AM
Help with find –mmin in a .ksh script tlavoie Shell Programming and Scripting 2 06-25-2009 05:00 PM
Any alternative of find . -mmin 20 Prat007 Solaris 2 07-21-2008 10:39 AM
find command using -mmin param jmbeltran HP-UX 3 11-11-2004 04:40 AM
no [find -mmin -1] svennie UNIX for Dummies Questions & Answers 3 10-14-2004 09:37 AM



All times are GMT -4. The time now is 11:41 AM.