today is tomorrow's past

today is tomorrow's past

I help people create remarkable things. Focus on the customer and quality. Opinions are my own. Photography is my other passion.

1-Minute Read

Reorg Time

I use Nextclouds image upload feature to backup all photos from my phone. I recently discovered that you could upload pictures from your phone into subfolders in the YEAR/MONTH/DAY/picturefile format.

After switching this feature on, I realized that all my previously uploaded 3000+ images and short videos lie flat in the Pictures folder. I needed a solution to organize all existing photos into the same subfolder structure.

I was thinking about writing a shell script and using ExifTool to read the EXIF metadata and move the pictures into their respective folder location based on their creation date. After checking the ExifTool documentation, I found out that ExifTool itself can help with this task. No need to write a script unless you need something very, very special.

This is what I used to reorganize all pictures files into their respective subfolders:

exiftool -d %Y/%m/%d "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" .

This one-liner will inspect all files in the current directory (.), examine the filemodifydate, createdate and datetimeoriginal exif tags in that order to determine the needed information to move the file into a subdirectory that will match the year (%Y), month (%m) and day (%d).

More examples about ExifTools superpower is available from the example page.

comments powered by Disqus

Recent Posts

Categories

About

Always something to think about