Author Topic: Help with writing a log of what happened  (Read 181 times)

pgriffy

  • Newbie
  • *
  • Posts: 2
Help with writing a log of what happened
« 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!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16877
    • ExifTool Home Page
Re: Help with writing a log of what happened
« Reply #1 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pgriffy

  • Newbie
  • *
  • Posts: 2
Re: Help with writing a log of what happened
« Reply #2 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.