Results 1 to 3 of 3
I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have:
Code:
find ...
- 05-26-2010 #1Just Joined!
- Join Date
- Apr 2005
- Posts
- 14
find syntax, exclude certain extensions and filter by age
I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have:
But I keep returning files that end in those extensions and I'm not sure if I'm using -cmin correctly??? Any help?Code:find /opt/edi/incoming -type f \! \( -name "*.archived" -name "*.error" \) -cmin 30
If there is a better way to do this (perl, etc) I'm open to options, this is for a nagios check.
- 05-27-2010 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Try this:
Code:find /opt/edi/incoming -type f \( ! -name "*.archived" -a ! -name "*.error" \) -cmin +30
- 05-27-2010 #3Just Joined!
- Join Date
- Apr 2005
- Posts
- 14
That works perfect, thanks!


Reply With Quote