Supposed to move files but copied instead

Started by lumiere, January 03, 2022, 07:34:20 PM

Previous topic - Next topic

lumiere

I have used the following command to move files from one folder to another:

exiftool -progress --ext pdf -api QuickTimeUTC '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal'  '-filename<CreateDate' '-filename<DateTimeOriginal' -d destination/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r source -efile3 errors.txt -if '$filesize# > 300000'

(the destination/ folder was empty)
But it turned out the files have been copied and not moved. What is wrong with this command that it copies and not moves ?

Phil Harvey

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

lumiere

Yes, that is right. Sorry.

How do I know however which files were copied and which moved ? I would need to compare both folders ? With thousands of files it is difficult. And the error file is not helpful to be honest ...

lumiere

I suspect I misundetstood what you had said.
Does that mean that all files have been placed in the destination folder but some of them still have its copies in the source folder ?

StarGeek

Based upon your command above, what it means is that for any file in which the CreateDate is written, a real embedded tag and not a file system property such as Filename or FileCreateDate, then the file will be copied.  For files in which CreateDate is not written, which would be any file that doesn't already have a DateTimeOriginal, that file would be moved.
"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

Thanks StarGeek.
If I delete the source folder I won't lose anything as all the pictures are in the destination folder anyway ?

StarGeek

Based upon your other posts, you're making long and complex commands.  I wouldn't delete anything until you were absolutely sure that things are working the way you want.

As for this command, add the -overwrite_original option.  That should leave the source directory empty.  If it doesn't, very carefully check any left over 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

Phil Harvey

Quote from: lumiere on January 04, 2022, 06:04:53 PM
If I delete the source folder I won't lose anything as all the pictures are in the destination folder anyway ?

BAD IDEA!  With your command, any file that doesn't contain CreateDate or DateTimeOriginal will not be moved or copied.  Also, files which give any type of error will not be moved/copied.

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

lumiere

Thanks Phil for pointing that - I wasn't aware it might happen.
Can you advice me then what is the safest way to migrate all files from one folder to another and rewrite CreateDate to have the same content of  DateTimeOriginal ?
Or I think the first step would be to find all files which don't contain DateTimeOriginal ? Can I do that with just exiftool withount using i.e.: find ?
If I make sure all files have DateTimeOriginal then I should be safe, shouldn't I ? Unless there is another scenario I haven't anticipated ...

lumiere

Quote from: Phil Harvey on January 04, 2022, 09:52:37 PM
Quote from: lumiere on January 04, 2022, 06:04:53 PM
If I delete the source folder I won't lose anything as all the pictures are in the destination folder anyway ?

BAD IDEA!  With your command, any file that doesn't contain CreateDate or DateTimeOriginal will not be moved or copied.  Also, files which give any type of error will not be moved/copied.

- Phil
Can you suggest any improvement to this command please ? How would you run it ?

Phil Harvey

I would add '-filename<filemodifydate' before the other arguments to set the file name.  Since FileModifyDate always exists, this insures that FileName will always be set.  The subsequent arguments will take precedence if CreateDate or DateTimeOriginal exists.  Then the only reason a file wouldn't be moved is if there was an error writing the file.

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

lumiere


lumiere

#12
I included the recommended parameter and used the following command:

exiftool -progress --ext pdf -api QuickTimeUTC '-filename<filemodifydate' '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal'  '-filename<CreateDate' '-filename<DateTimeOriginal' -d destination/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r source -efile3 errors.txt -if '$filesize# > 300000'

but it copied all files and not moved them.
I am not sure why ...

Phil Harvey

CreateDate is a "real" tag.  Do you mean FileCreateDate?

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

lumiere

To be honest I am struggling with understanding your question ...
CreateDate has been used twice.