I was trying to copy files across and used the following command
exiftool -progress --ext pdf -api QuickTimeUTC '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' '-filename<CreateDate' '-filename<DateTimeOriginal' \
-d destination/pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r source_dir -efile3 errors.txt -if '$filesize# > 300000' -o
All the files had literally "%Y", "%m", etc in their names instead of numbers. Moving files (without "-o") worked fine whereas copying didn't.
With all those parameters above what is the syntax to copy files ?
The -o option requires an argument. Just use "." for a dummy argument since you are already setting the output directory. (ie. use -o .)
- Phil
Does the position of -o . matter ?
No. You just can't split the two parameters with something else in between.
Position almost never matters in an exiftool command. There are a few exceptions such as the -Config option (https://exiftool.org/exiftool_pod.html#config-CFGFILE) and the -Common_Args option (https://exiftool.org/exiftool_pod.html#common_args).
Something is not right:
experiment$ tree -L 1 .
.
├── source
└── destination
2 directories, 0 files
I used the following command
exiftool -o . -progress --ext pdf -api QuickTimeUTC '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' '-filename<CreateDate' '-filename<DateTimeOriginal' -d destination/pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r source -efile3 errors.txt -if '$filesize# > 300000'
And the files are being created also in the top level folder as well:
experiment$ tree -L 1 .
.
├── 04031177.png
├── 139467424.png
├── 140599528.png
├── 140600256.png
├── 140602571.gif
...
├── 193970638.png
├── source
└── destination
└── errors.txt
One of those files in the top level folder has the following exif data:
experiment$ exiftool -time:all -a -G0:1 -s f526646448.jpg
[File:System] FileModifyDate : 2022:01:02 16:52:10+00:00
[File:System] FileAccessDate : 2022:01:02 16:55:42+00:00
[File:System] FileInodeChangeDate : 2022:01:02 16:52:10+00:00
[EXIF:IFD0] ModifyDate : 2009:09:15 10:20:55
Why it is not created in the following folder destination/pictures/2009/09/15/...... ?
You're only writing Filename when one of two tags exist
'-filename<CreateDate' '-filename<DateTimeOriginal'
Your example PNG doesn't have either of those. When Filename (or Directory) is written, that destination will override the directory specified by the -o (-out) option (https://exiftool.org/exiftool_pod.html#o-OUTFILE-or-FMT--out) (see first paragraph in that link).
You can either set the -o option to be the default location where you want files that don't match either of the above filename commands, or add a default location in front of those
(trailing slash is needed here)
-o /path/to/default/ '-filename<CreateDate' '-filename<DateTimeOriginal'
or
-o . -directory=/path/to/default/ '-filename<CreateDate' '-filename<DateTimeOriginal'
That makes sense.
Thanks a lot StarGeek :)