How can I make this ExifTool command "Safer" ?

Started by yama, September 07, 2024, 08:11:36 PM

Previous topic - Next topic

yama

Hello,

I'm in the process of trying to clean up a little over a decades worth of pictures strung across hundreds of folders. I've included the command i'm using below to take one working directory at a time, and place the images into categorized folders in the structure of YYYY\MM-MMM.

My question is - can anyone give me suggestions on how I could possibly improve this command? One thing I'm aware of but not sure if I'm seeing instances of is - if an image has the same name and gets placed into the same directory structure, I'm likely to lose data.

Any suggestions welcome. Thank you!

"exiftool(-k).exe" -r -ext jpg -ext png -ext jpeg -ext mov -ext raf -P -progress -o . -d "%Y/%m-%b" "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" "..\Pictures_Backup\working_directory"

StarGeek

Quote from: yama on September 07, 2024, 08:11:36 PMif an image has the same name and gets placed into the same directory structure, I'm likely to lose data.

This will never happen. Exiftool will never overwrite an existing file with another file, except in the case of text output via the -w (-TextOut) option while using the ! modifier.

To deal with possible name collisions, you have to switch from Directory to Filename. You can include directory paths when doing so. The %c variable is used to add a copy number (see the above -w option for details).

-d "%Y/%m-%b/%%f%%-c.%%e" "-Filename<filemodifydate" "-Filename<createdate" "-Filename<datetimeoriginal" "..\Pictures_Backup\working_directory"

The filename percent variables, %f/%c/%e, need to have the percent sign doubled when used in a -d (-dateFormat) format string. When used in a Windows .bat file, they need to be doubled again (see FAQ #27, My ExifTool command doesn't work from a Windows .BAT file).
"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