First time using ExifTool -- Breaking something simple here.

Started by KR0SSED0UT, October 11, 2018, 09:29:58 PM

Previous topic - Next topic

KR0SSED0UT

Let me start by saying -- hello, new to the forums, new to ExifTool, started using it today.

Here's what I've got going on -- friends gave me a 240GB photo collection, I backed it up and removed duplicate images already, dropping it down to ~180GB. The filesystem, naming system, etc is all a mess -- I've never had to attempt to organize a filesystem of this size before. I've got it on a blank 4TB external HDD so I can attempt to organize it before moving it to the NAS I'm doing for them.

So here's what I'm trying to do;

Pull from X:/PICTURES (which is a total mess, so using the command -r, which from what I understand, means 'recursively,'to pull everything) and dump it, organized, into X:/REORGANIZED, Which would ideally be organized something like this;

X:/REORGANIZED/yyyy pictures/mm yy/mm_dd_yy.jpg (these files span for over a decade, and I haven't come up with a good naming scheme for the .jpg files themselves yet in terms of a good, logical hierarchy)

And this is my exiftool.bat file;

exiftool -d %Y-%m "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" X:/PICTURES -r

I know it doesn't do exactly what I described I wanted (I haven't been able to figure out how to set an output directory, but I'm getting there, referencing heavily off of this (https://exiftool.org/filename.html)

Whenever I run this, it simply starts pulling from X:/Pictures and dumping into a folder called X:/m

I assume this has to do with the month modifier at the start of the command line, but I can't seem to get it to quit doing this! I'm sure I'm missing something very simple.

Phil Harvey

Quote from: KR0SSED0UT on October 11, 2018, 09:29:58 PM
X:/REORGANIZED/yyyy pictures/mm yy/mm_dd_yy.jpg

And this is my exiftool.bat file;

exiftool -d %Y-%m "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" X:/PICTURES -r

I know it doesn't do exactly what I described I wanted

Try this:

exiftool -d "X:/REORGANIZED/%%Y pictures/%%Y-%%m/%%m_%%d_%%Y.%%%%e" "-filename<filemodifydate" "-filename<createdate" "-filename<datetimeoriginal" -o . X:/PICTURES -r

Your original command didn't work because "%" characters need to be escaped by adding another "%" in a .bat file.

I added the -o . to copy the files instead of moving them.

I think you will probably have to revise the file name to either add "%%%%-c" or "%%H%%M%%S", or both to avoid name conflicts.

Read here for more help/examples renaming/moving files.

- Phil

...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 ($).

KR0SSED0UT

Following your advice, this seems to be working the best;

exiftool -d "X:/REORGANIZED PICTURES/%%Y/%%m-%%Y/%%m_%%d_%%Y_%%H%%M%%S%%%%-c.%%%%e." "-filename<filemodifydate" "-filename<createdate" "-filename<datetimeoriginal" -o . X:/PICTURES -r

Ran it until it did about 1GB of pictures and stopped it to check, it seems to be sorting correctly, not throwing up errors or screwing up file extensions.