Help sorting exiting files into an EXIF based directory structure

Started by JeremyLaurenson, December 03, 2023, 02:07:16 PM

Previous topic - Next topic

JeremyLaurenson

I have almost a TB of files on a Mac that Id like to sort based on exif data, and I am having trouble wrapping my brain around the comandline in order to get what I am looking for.

I have created a copy of all the files in a PicturesSource folder and I would like to process each one to move it to a destination folder if the EXIF data exists, otherwise just skip it so I can go in and manually clean up.

/Volumes/Pegasus R4i/PicturesSource contains subdirectories to read from
I would like to save to
/Volumes/Pegasus R4i/Photos/YEAR/MONTH/YYYY-mm-dd-OriginalFilename.extension

Where I am at in my attempts is:
exiftool -d "%Y/%B/%Y-%m-%d" "-directory</Volumes/Pegasus R4i/Photos/$DateTimeOriginal" "/Volumes/Pegasus R4i/PicturesSource" -r

I am getting nothing but Warnings, and no actual file moves:

Warning: Invalid tag name '/volumes/pegasus r4i/photos/'. Use '=' not '<' to assign a tag value - /Volumes/Pegasus R4i/PicturesSource/2013/Sep/DSC_4679.JPG

Are there any step by step videos to help me understand the command line structure and what the heck is going on?

Thanks

J

StarGeek

If you look at the file path in that error message, you will notice that nothing from the date is listed there, so $DateTimeOriginal is being treated as an empty string.

Since you are on a Mac, the terminal treats anything that starts with a dollar sign as a terminal variable, which will be empty in this case.

You'll need to use single quotes around any part of the command that has a dollar sign in it.
exiftool -d "%Y/%B/%Y-%m-%d" '-directory</Volumes/Pegasus R4i/Photos/$DateTimeOriginal' "/Volumes/Pegasus R4i/PicturesSource" -r
"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