ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: s21jb on December 21, 2021, 04:03:24 PM

Title: Create Directory by Make and Model
Post by: s21jb on December 21, 2021, 04:03:24 PM
I have a collection of image files taken throughout the years using various camera models. The files are stored in sub-directories with no organized structure. I would like to recursively scan the sub-directories and copy these files in a sorted subdirectory structure that follows 'Make/Model/CreateDate/' (i.e. Nikon/D610/20191025/).
I prefer to use Ubuntu LTS 20.04 to run Exiftool.
I would appreciate any help or hint on how to get around doing so using Exiftool.

I'm quite sure that this is a standard use case for Exiftool. however I am a linux novice and could not find a working solution in the forums, so please forgive me if this is a rehash of an old question.

Thank you in advance!
Title: Re: Create Directory by Make and Model
Post by: StarGeek on December 21, 2021, 04:15:42 PM
See this post (https://exiftool.org/forum/index.php?topic=8980.msg46298#msg46298).  You have to change the date string to your format, %Y%m%d.  See the -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) for more details.
Title: Re: Create Directory by Make and Model
Post by: s21jb on December 21, 2021, 10:03:11 PM
Quote from: StarGeek on December 21, 2021, 04:15:42 PM
See this post (https://exiftool.org/forum/index.php?topic=8980.msg46298#msg46298).  You have to change the date string to your format, %Y%m%d.  See the -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) for more details.

Thank you for the reply. And how do I create directory name by Make and Model?
Title: Re: Create Directory by Make and Model
Post by: StarGeek on December 21, 2021, 10:09:19 PM
Exactly as shown, though you might want to prepend your target directory.  And add the -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse).

You would test with this command to make sure the output would be what you want, then change Testname to Filename to actuall do the moving.
exiftool -r '-Testname</path/to/new/location/${make;}/${model;}/${CreateDate}/%f%-c.%le' -d %Y%m%d -r /path/to/files/