I remember years about trying to organise my photos by year and month in respective folder with a shell script using exiftool to get the year and month for folders.
I failed to get it to work, my lack of knowledge with bash scripting. I might try again some time. I'm convinced it's a one liner.