Help - what is wrong

Started by Gus, June 08, 2025, 04:25:47 PM

Previous topic - Next topic

Gus

Hi
I have tried to find what I am doing wrong, but I fail terribly and therefore hope some smart person can help me.
There are several issues I would like to solve. Unfortunately I am not so good at programming so I can summarize the problems so I will explain everything in order. Forgive me for that.

I have a NAS that several users can access and have their own space / folders.
Each user has the following map structure for photos

Photos
  |
  |-New photos. (aka Foto_Nya)
  |
  |-Photos.  (aka Foto)
      |
      |-2025-06-June
      |-2025-05-May
      ... etc

Backup_Photos.  (aka Foto_Backup)
      |
      |-2025-06-June
      |-2025-05-May
      ... etc


I have at the moment 5 users each with their own home-folders etc. on the NAS.

I have a linux server to which I have mounted all 5 users folders. On the linux server, I have created a script that looks like this:

echo "Nu kopierar vi foton $(date)"
echo "User1"
exiftool -o . -d '/mnt/synology_foto_backup/User1/Foto_Backup/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User1/Foto_Nya
exiftool -d '/mnt/synology_homes/User1/Foto/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User1/Foto_Nya
exiftool -directory='/mnt/synology_homes/User1/Foto/EXIF_saknas' /mnt/synology_homes/User1/Foto_Nya
echo "User2"
exiftool -o . -d '/mnt/synology_foto_backup/User2/Foto_Backup/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User2/Foto_Nya
exiftool -d '/mnt/synology_homes/User2/Foto/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User2/Foto_Nya
exiftool -directory='/mnt/synology_homes/User2/Foto/EXIF_saknas' /mnt/synology_homes/User2/Foto_Nya
echo "User3"
exiftool -o . -d '/mnt/synology_foto_backup/User3/Foto_Backup/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User3/Foto_Nya
exiftool -d '/mnt/synology_homes/User3/Foto/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User3/Foto_Nya
exiftool -directory='/mnt/synology_homes/User3/Foto/EXIF_saknas' /mnt/synology_homes/User3/Foto_Nya
echo "User4"
exiftool -o . -d '/mnt/synology_foto_backup/User4/Foto_Backup/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User4/Foto_Nya
exiftool -d '/mnt/synology_homes/User4/Foto/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User4/Foto_Nya
exiftool -directory='/mnt/synology_homes/User4/Foto/EXIF_saknas' /mnt/synology_homes/User4/Foto_Nya
echo "User5"
exiftool -o . -d '/mnt/synology_foto_backup/User5/Foto_Backup/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User5/Foto_Nya
exiftool -d '/mnt/synology_homes/User5/Foto/%Y-%m-%B/%y-%m-%d %H.%M.%S%%+2nc.%%e' '-filename<createdate' /mnt/synology_homes/User5/Foto_Nya
exiftool -directory='/mnt/synology_homes/User5/Foto/EXIF_saknas' /mnt/synology_homes/User5/Foto_Nya

My intention was to place photos in the folder Foto_Nya and then have the script sort them:
1. Copy all photos and videos to the photo-folder and rename all files according to their date of creation and sort them in folders.
2. Move all photos from new photo-folder to the backup-folder and rename them and sort them in folders.
3. Move all photos missing exif-data to a separate folder (EXIF_saknas) for manual sorting

However - I have the following problems:
Works fine for all users except User2. For User2, photos are copied to backup-folder and to the photo-folder but then all photos are moved to the folder intended for photos without exif-data, even if the photo has exif-data.
I have tried this with the same photos for all 5 users

Then - for photos placed in Foto_Nya for User2, photos are also transfered to the linux server and the folder where the script is located. I have not seen this for User1 and as I am writing this, realize I have not investigated if it happens for User3-5 also.

All help to solve this problem is highly appreciated

/Gus

Phil Harvey

Hi Gus,

As you know, the commands for User1 and User2 are identical.  So any difference must be in the files themselves or the filesystem.  I don't see how this could do it, but are there any special characters in User2's account name?  Also, check the directory/file permissions and groups.  But problems like this should probably generate warnings or errors from ExifTool. You should try a controlled test on the same file in both accounts and save the ExifTool output.  If that doesn't yield any differences, try adding the -v2 option and running the test again.

- 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 ($).

StarGeek

Quote from: Gus on June 08, 2025, 04:25:47 PMFor User2, photos are copied to backup-folder and to the photo-folder but then all photos are moved to the folder intended for photos without exif-data, even if the photo has exif-data.

How are you checking to see if it has EXIF data? Is it through something like the Synology photo app? If so, has the data you are looking for been added through the app interface?

Try looking at the files directly with exiftool. That will show you the data that is actually in the files. If the data isn't there, then check to see if there's an XMP sidecar file, i.e. a file with the same name but with a .XMP extension.

Or if the data was added through an app, it might be in the apps database and not actually added to the file. I faintly recall something about the photo app saving edited data in a database and not adding it to the files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype