Author Topic: Exclude Sub-DIR from -r DIR  (Read 1884 times)

Stephen Marsh

  • Sr. Member
  • ****
  • Posts: 229
Exclude Sub-DIR from -r DIR
« on: August 15, 2016, 08:13:29 AM »
I know that we can target specific file extensions using say -ext .jpg or exclude them with --ext .jpg when processing with -r

However, if one is targeting a top level directory – that contains various files and sub-directories, is there a way to exclude a specific sub-directory, while still allowing recursive processing of all other files and sub-folders within that top level targeted directory?

Top-level-DIR
     -Sub-DIR-1 <—— Process this sub-DIR
     -Sub-DIR-2 <—— But don’t process this specific sub-DIR
     -Sub-DIR-3 <—— Process this sub-DIR

I have looked through the forum and could not find any examples for excluding a directory.

I did try '--Sub-Dir-2' before the main DIR in the command, however the contents was still processed by the -r command…


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Exclude Sub-DIR from -r DIR
« Reply #1 on: August 15, 2016, 08:15:23 AM »
Yes.  The option to ignore a sub-directory by name is -i SUBDIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Stephen Marsh

  • Sr. Member
  • ****
  • Posts: 229
Re: Exclude Sub-DIR from -r DIR
« Reply #2 on: August 15, 2016, 08:36:18 AM »
Thank you Phil, even though I searched high and low… it was indeed documented, thank you for your invaluable time mate!

http://www.exiftool.org/exiftool_pod.html

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Exclude Sub-DIR from -r DIR
« Reply #3 on: August 15, 2016, 08:44:00 AM »
I know.  There are too many options... :P
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Stephen Marsh

  • Sr. Member
  • ****
  • Posts: 229
Re: Exclude Sub-DIR from -r DIR
« Reply #4 on: August 15, 2016, 09:18:57 PM »
Haha, it could be worse Phil, the product and support documentation and product user community could be lightweight and next to non-existent!

Too much info is better than not enough, it is just a process of finding what you need.

Thank you for all your efforts!

Kugelblitz

  • Full Member
  • ***
  • Posts: 42
Re: Exclude Sub-DIR from -r DIR
« Reply #5 on: July 28, 2020, 05:45:05 PM »
Hey Phil,

how can I ignore several Folders?

I run a command and it was cancelled before completion with the "501 Killed" message.   

======== /var/services/homes/martin/Drive/Moments/Fotos/2010/2010-09-09 Chalkadiki/P9090233.jpg [58936/181167]
======== /var/services/homes/martin/Drive/Moments/Fotos/2010/2010-09-09 Chalkadiki/P9090234.jpg [58937/181167]
======== /var/services/homes/martin/Drive/Moments/Fotos/2010/2010-09-09 Chalkadiki/P9090235.jpg [58938/181167]
01-live.sh: line 5:   501 Killed
exiftool -Sep ", " -@ 01-separate-tags-by-comma-if.args -common_args -ext jpg -ext tif -ext cr2 -ext dng -ext nef -ext nrw --ext png --ext mov --ext avi --ext m4v --ext mp4 --ext gif -Sep ", " -overwrite_original_in_place -P -r -i @eaDir -fast -progress ~/Drive/Moments/Fotos/ -efile _01_log_efile.txt 2> _01_log_error.txt


looks like it processed the Folders until the year 2010. Now I would like to ignore all folders before that.
I tried
-i "@eaDir 1974 1975 1978 1979 1980 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009"
 
But that did not work.


EDIT:
That works

-i @eaDir -i 1974 -i 1975 -i 1978 -i 1979 -i 1980 -i 1984 -i 1985 -i 1986 -i 1987 -i 1988 -i 1989 -i 1990 -i 1991 -i 1992 -i 1993 -i 1994 -i 1995 -i 1996 -i 1997 -i 1998 -i 1999 -i 2000 -i 2001 -i 2002 -i 2003 -i 2004 -i 2005 -i 2006 -i 2007 -i 2008 -i 2009
« Last Edit: July 28, 2020, 06:15:50 PM by Kugelblitz »