Author Topic: Help! Can't make a simple copy work :(  (Read 126 times)

desperatehousescripter

  • Newbie
  • *
  • Posts: 2
Help! Can't make a simple copy work :(
« on: August 11, 2020, 04:40:37 PM »
 :(
I dont understand any of it. Please, help!

What I want

I plug a SD card from my Sony camera in the SD card reader of my linux server (UNRAI) and a script copies:
- the JPGs to /Camera/Photo/YearCreated/YYYY-MM-DD (e.g. /Camera/Photo/2020/2020-10-01)
- the MP4s to /Camera/Video/YearCreated/YYYY-MM-DD

I downlaoded latest exiftool for windows to test easier.

File Structure:
exiftool.exe in a directory, under whic I have:
- a example structure of my Sony SD card
\inc\DCIM\100MSDCF - contains JPGs
\inc\MP_ROOT\100ANV01 - contains .MP4 and .THM files
\inc\PRIVATE - some other stuff
\out\ - here the output structure is created /Camera/Photo/YearCreated/YYYY-MM-DD



Here is cmd line I used
exiftool -r -o -ext JPG "-FileName<DateTimeOriginal" -d out/Camera/Photo/%Y/%Y-%m-%d/%%f.%%e inc -v5

I got the output directory structure for JPGs and MP4s
it processed all JPGs, but also THMs and MP4s
it created a file "-ext" in the top directory
it copied JPGs but also files with extension THM even though I explicit asked for JPG only

What am I doing wrong?!

I also tried
exiftool -r -o -ext JPG "-Directory<DateTimeOriginal" -d out/Camera/Photo/%Y/%Y-%m-%d inc
but it didnt work at all

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3951
Re: Help! Can't make a simple copy work :(
« Reply #1 on: August 11, 2020, 04:46:40 PM »
Here is cmd line I used
exiftool -r -o -ext JPG "-FileName<DateTimeOriginal" -d out/Camera/Photo/%Y/%Y-%m-%d/%%f.%%e inc -v5

The -o (Outfile) option requires a second argument, either an file or directory name or a format string.  This is eating up the -ext part of your command.  There should have been a Error: File not found - JPG as part of the output.

Try using a dot for the second argument.
-o .
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

desperatehousescripter

  • Newbie
  • *
  • Posts: 2
Re: Help! Can't make a simple copy work :(
« Reply #2 on: August 11, 2020, 05:20:26 PM »
Here is cmd line I used
exiftool -r -o -ext JPG "-FileName<DateTimeOriginal" -d out/Camera/Photo/%Y/%Y-%m-%d/%%f.%%e inc -v5

The -o (Outfile) option requires a second argument, either an file or directory name or a format string.  This is eating up the -ext part of your command.  There should have been a Error: File not found - JPG as part of the output.

Try using a dot for the second argument.
-o .

YES! Thank you!

Just in case anyone else fights the same.
What worked the way I wanted is :
exiftool -r -o out/ -ext JPG "-Directory<CreateDate" -d out/Camera/Photo/%Y/%Y-%m-%d inc -v5
exiftool -r -o out/ -ext MP4 "-Directory<CreateDate" -d out/Camera/Video/%Y/%Y-%m-%d inc -v5

I had to specify "out/" 2 times: as the "-o" parameter and also as part of the "-d" parameter to make it work.
Which is a bit odd...


StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3951
Re: Help! Can't make a simple copy work :(
« Reply #3 on: August 11, 2020, 05:24:54 PM »
A single dot to represent the current directory would have worked. Because you were using the Directory pseudo-tag, the -o just needed a dummy directory to work.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.