Directory structure creation using -o -r -d

Started by break80, August 18, 2016, 12:46:20 PM

Previous topic - Next topic

break80

As in Example 6 of the "Writing Filenames and Directory tags" ( https://exiftool.org/filename.html ), you show an example using -r and -d together.   In my case, I want to retain the originals and later delete them if all goes well. 

I am running this command in a Windows 10 CMD box in the folder where the original files are located:

    exiftool -o -r -d "C:\Users\Jim\Pictures/test2/"%Y/%m/%Y-%m-%d" "%H-%M-%S%%-c.%%e -m -P "-filename<filemodifydate" .   

The above creates the directory structure I want in my Pictures folder (test2/year/month) and the filenames I want (year-month-day  hour-min-sec)....but it does NOT recurse through all the source folders thus it misses tons of files in folders under the current folder.

If I remove the -o, it does recurse through all the subfolders, and does creates all structures and filenames I want, but it does not retain the original files.

I have tried several different order of -o, -r, -d, and tried moving the -o into other locations on the command thinking it may be order or location dependent, but nothing works for me.  All other orders and locations give errors.

Can you help me to generate the folders and filenames I want?   

Hayo Baan

The -o option takes an argument specifying where the file should go, see the documentation for more info. In your case, I think this might work: -o "%d/%f.%e". I haven't tried it though.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

You forgot to specify the directory for the -o option.  It doesn't matter what you specify because you are overriding the directory when writing the FileName.  So just -o dummy/ will do.

- Phil

Edit: Also, there is something funny with the quotes in your original command.  Try this:

exiftool -o dummy/ -r -d "C:/Users/Jim/Pictures/test2/%Y/%m/%Y-%m-%d %H-%M-%S%%-c.%%e" -m -P "-filename<filemodifydate" .
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

break80