I have a directory structure like this:
Dir1
Dir2
Sdir1
SDir2
Etc
I want to move recursively all files that have invalid DateTimeOriginal to a Temp sub-directory below each existing (Sub)Directory. So that I will get something like this:
Dir1
Temp
Dir2
Temp
Sdir1
Temp
SDir2
Temp
Etc
Temp
I am trying to use the following command line:
exiftool -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00"))' "-Directory=temp/" -overwrite_original -r. .
But instead I am getting everything pushed into the first level Temp directory like this:
Dir1
Temp <--- Everything is going here!
Dir2
Sdir1
SDir2
Etc
What am I doing wrong?
Try using
"-Directory<$Directory/temp/"
If you mean like this:
exiftool -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00"))' "-Directory<$Directory/temp/" -overwrite_original -r. .
That didn't create or move anything.
Sorry, I didn't notice you were using single quotes in your first post. I'm assuming that means you're on Linux/Mac. If so, swap the quotes in the example I gave. Using double quotes when there's a dollar sign in the argument causes bash to believe that there is a bash variable in the command.
Got it... On Mac have to use single quotes:
exiftool -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00"))' '-Directory<$Directory/temp/' -overwrite_original -r. .
Thanx