Main Menu

Move, Copy and change name

Started by Gus, December 17, 2024, 04:25:09 PM

Previous topic - Next topic

Gus

Hi
Wonderful I found ExifTool since it seems like it is the tool to help me with my ambition.

I am trying to set up a way to handle the photos I transfer from phone or camera to my computer. For your knowledge, I will run the script on a Linux server.

Hopefully I will be able to explain my goal.

1. I transfer the photos to a certain folder on my computer.
2. The script is run on schedule once a day
3. The outcome is the following (not sure about the specific order)
  a. All photos have been renamed with the name in the following format YYYY-MM-DD hh.mm.ss
  b. if there is only one phot taken that time, the name is as in above, but if there are several photos taken at the same time, there is an incremental numbering so the name ends with ... 01.jpg and ... 02.jpg etc. (I found an explanation how to do this in this thread https://exiftool.org/forum/index.php?topic=16587.0)
  c. All photos have been moved to a folder based on date the photo was taken. The folders are named YYYY-MM (for example 2024-01, 2024-02 and so on) If the folder for the specific month the photo was taken, does not exist, the folder is created.
   c. version 2... Instead of naming the folders 2024-01, the folders are named 2024-01-January, 2024-02-February and so on. If that is very difficult I have to go with option 1 and only naming them 2024-01 but if it is possible to add name of month I would like to do so.

Now the tricky part:
I have duplicate folders with photos under different parent folders. Like this:

Photos_1.                       Photos_2.
|                                        |
|-2024-01-January           |-2024-01-January
|                                        |
|-2024-02-February          |-2024-02-February

The reason - I would like to have one folder (Photos_1) which I can edit and work with in different photo editing softwares etc. The other folder (Photos_2.) are only for backup, if I somehow mess up with a photo I know I have a copy of the original one.

Thus, I need the photos I transfer from my camera to the computer somehow end up in both Photos_1 and Photos_2. I also need the naming pattern to consider if there already is a photo in that folder with the exact time and thus add the incremental numbering (I put both my wife's and my own photos in the same folder).

In the end, I want to know if some photo is not copied/moved to BOTH folders. I want the folder I put the photos in from the camera to be empty in the end but I do not want to accidentally delete a photo that has not been copied to both folders (both Photos_1 and Photos_2).

The renaming I think I can figure out and also moving or copying the photos to one folder, but when I want to have the same photo in two locations, I can't find an answer how to do that.

Difficult question I presume but if there is someone who can help me it is here they are - I believe.

Phil Harvey

This will require 2 commands to copy the file to 2 different locations.

The commands will be something like this:

1. exiftool -o . -d "Photos_1/%Y-%m-%B/%Y-%m-%d %H.%M.%S%-2c.%e" "-filename<createdate" DIR

2. exiftool -d "Photos_2/%Y-%m-%B/%Y-%m-%d %H.%M.%S%-2c.%e" "-filename<createdate" DIR

The first command copies the files due to "-o ." in the command, and the 2nd command moves the files.

Then maybe you want a 3rd command to move files which didn't have a CreateDate:

3. exiftool -directory="not_moved" DIR

See this page for more details about moving/renaming files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).