Trying to copy files - it didn't work correctly (wrong destination names)

Started by lumiere, January 02, 2022, 05:08:10 AM

Previous topic - Next topic

lumiere

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 ?

Phil Harvey

The -o option requires an argument. Just use "." for a dummy argument since you are already setting the output directory.  (ie. use -o .)

- 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

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 and the -Common_Args option.
"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

lumiere

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/...... ?

StarGeek

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 (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'
"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

lumiere