copying from one directory to another using metadata -model

Started by engltayl, April 22, 2018, 09:06:11 AM

Previous topic - Next topic

engltayl

Hi,

Really struggling trying to do the following. Can anybody help?

I would like to move all files from one directory (and sub directories) which have a tag (camera model = Nikon D90) to another directory. I've had some success with the following except it copies instead of moves. It also seems to lose the metadata for NEF files.

exiftool -r -model='NIKON D90' '/volume1/backup drive/test1' -o '/volume1/backup drive/test2'

Many Thanks

StarGeek

With -model='NIKON D90', you are setting the Model tag to a value of "NIKON D90".  What I think you want is to move the file if the model is equal to NIKON D90, right?  If that's the case, you want a command something like this:
exiftool -r -if '$Model eq "NIKON D90" -Directory=/volume1/backup drive/test2 /volume1/backup drive/test1
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

engltayl

Great. Thanks for the help. It nearly works but it seems to fail on condition. There are definitely files in the DIR with model=NIKON D90. Cant figure out why it keeps failing condition.

exiftool -r -if '$model eq "NIKON D90"'' -directory=/volume1/backup drive/test2' '/volume1/backup drive/test1'
    1 directories scanned
   39 files failed condition
    0 image files read

Hayo Baan

What does exiftool -model way for your files? The match must be exact to work.
Hayo Baan – Photography
Web: www.hayobaan.nl

StarGeek

Quote from: engltayl on April 22, 2018, 02:04:13 PM
exiftool -r -if '$model eq "NIKON D90"'' -directory=/volume1/backup drive/test2' '/volume1/backup drive/test1'

You have too many quotes here.  After D90, you have (Doublequote)(Singlequote)(Singlequote).  It should just be (Doublequote)(Singlequote).

Here's an alternate command to try:
exiftool -r -if '$model=~/NIKON D90/i' -directory=/volume1/backup drive/test2' '/volume1/backup drive/test1'

The =~ structure uses Regular Expressions (RegEx) to test for a match if you're familiar with them.  This works well for simple alphanumeric strings but becomes more complex if you need to use other characters like slashes, brackets, or parenthesis.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

engltayl

Thanks for the help. The following seems to work:

exiftool -r -if '$model eq "NIKON D90"' -directory='/volume1/backup drive/test2' '/volume1/backup drive/test1'