ExifTool Forum

ExifTool => Newbies => Topic started by: pgriffy on February 16, 2020, 04:19:03 PM

Title: Help with writing a log of what happened
Post by: pgriffy on February 16, 2020, 04:19:03 PM
I've got a mess of hundreds if not thousands of photos with a directory structure sometimes 7 or 8 folders deep. Seems like most of these paths end with a .Thumbnails folder with thumbnail versions of the pictures in the parent folder.  I think I have figured out how to rename all of the images in any folder named .Thumbnails, but I'd kinda like to have a log of what the old and new path/folder name is.  That's the part I can't figure out.
Here is what I have so far:
   
   exiftool '-directory=/mnt/e/thumbnails/%:3d' -if '$Directory =~ /.Thumbnails/' -r. /mnt/e/todo/

this takes everything in a .Thumbnail folder in /mnt/e/todo and all subfolders and moves them to /mnt/e/thumbnails/todo/...
(I think if I wanted to make it .../thumbnails/... instead of .../thumbnails/todo/... I just make it %:4d, but I'm not super concerned about that right now.)

First off, is that a bad way to go about this, and second, is it possible to get a file something like this (header line is just for clarity, doesn't need to be in file) to show what happened in case it all goes wrong?

Old Path                                                           New Path
/mnt/e/todo/pictures/.Thumbnails/123.jpg         /mnt/e/thumbnails/todo/pictures/.Thumbnails/123.jpg
/mnt/e/todo/pictures/2005/.Thumbnails/456.jpg /mnt/e/thumbnails/todo/pictures/2005/.Thumbnails/123.jpg

Thanks!
Title: Re: Help with writing a log of what happened
Post by: Phil Harvey on February 16, 2020, 09:20:37 PM
You can do something like this:

exiftool '-directory=/mnt/e/thumbnails/%:3d' -if '$Directory =~ /.Thumbnails/' -r. /mnt/e/todo/ -v | grep -e '-->' > out.txt

- Phil
Title: Re: Help with writing a log of what happened
Post by: pgriffy on February 17, 2020, 10:02:37 AM
Awesome! thank you. I'm not much of a linux person, I am doing this in the windows linux shell, so grep and all the other "simple" things are a mystery to me,
but that is working just fine.