Moving Some Files

Started by klind, October 14, 2019, 08:24:23 PM

Previous topic - Next topic

klind

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?
Ken Lind

StarGeek

Try using
"-Directory<$Directory/temp/"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

klind

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.
Ken Lind

StarGeek

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

klind

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
Ken Lind