Main Menu

Folder structure with dates

Started by Spartacus, May 03, 2021, 09:27:13 AM

Previous topic - Next topic

Spartacus

Hi all,
Hi all,
I found this  tool and I would like to automate the sorting of my pictures but I cannot get it work as needed.
All pictures are in a folger called "source"

The following structure should be created from  the EXIF-Tag "datetimeoriginal" in a target directory called "target".

Example in the target folder:

yyyy (2021)
|- mm-January (01-January)
   |- dd-mm-yyyy (30-01-2021)
       |-file.jpg (DSC00067.JPG)
The corresponding pictures should be moved into the corresponding folders.

I can create a directory sructure with the command:
exiftool -d %d-%m-%y "-directory<datetimeoriginal" DSC00067.JPG
But this shows only the  month on the secend folder structure and not the above needet structure.

The command should run on a headless linux shell

Can someone help here?
Spartacus
 
 

StarGeek

All you need to do is add in the rest of the directory structure to the -d (dateFormat) option format string.  The date format codes can be found under Common Date Format Codes.  See the full page for more details.

exiftool -d '%Y/%m-%b/%d-%m-%Y' '-directory<datetimeoriginal' DSC00067.JPG
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Spartacus

Hi,
thank you very much for quick response. I found a solution on my own and it works fine, including a renaming of the filenname.
exiftool -o . '-Filename<DateTimeOriginal' -d /home/OUTPUT/%Y/%m-%B/%d-%m-%Y/%Y%m%d%%-.2nc.%%le *.JPG -r /home/INPUT

Spartacus