Help! Can't make a simple copy work :(

Started by desperatehousescripter, August 11, 2020, 04:40:37 PM

Previous topic - Next topic

desperatehousescripter

 :(
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

Quote from: desperatehousescripter on August 11, 2020, 04:40:37 PMHere 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 .
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

desperatehousescripter

Quote from: StarGeek on August 11, 2020, 04:46:40 PM
Quote from: desperatehousescripter on August 11, 2020, 04:40:37 PMHere 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

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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).