Sort into Directory AND avoid duplicate files

Started by pwoodrow1, September 11, 2017, 01:02:40 PM

Previous topic - Next topic

pwoodrow1

Hello,
I have been trying to get pictures to be sorted based on creation date into a directory structure. It works well. However, duplicate files will not be moved. For the life of me, I cannot figure out how to get the command correct such that it will increment the file name if it already exists.

Here is what I have been trying:

exiftool '-Directory<CreateDate' -d dest/%Y/%Y-%m -w "%%+nc%%f.%%le" -r origin/

Any suggestions?

Also, is there a way for it to use CreateDate, but if that does not exist, then use FileModifyDate? It would just prevent me from having to run the command twice with the different input to the directory.

StarGeek

You will want to use Filename instead of Directory and include the directory and filename formats together.  Also, I think you're misunderstanding what the -w does.  It writes the text output of exiftool to a file, which is why it has the alternate form of -textOut.  If you've run your command as written, you probably have a bunch of text files in your starting directory with image extensions.

For your second question, from the docs, note 1 on tags:
"Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence "

So if we do a move with the FileModifyDate tag followed by one with CreateDate, for any file that actually has a CreateDate tag, the second assignment will take precedence.  Files without a CreateDate tag will ignore the second assignment in favor of the first (FileModifyDate) one.

So try this:
exiftool -d "dest/%Y/%Y-%m/%%+nc%%f.%%le" -r "-Filename<FileModifyDate" "-Filename<CreateDate" origin/
"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

pwoodrow1

That worked perfectly. Thanks for the explanation!