How to COPY files and not move them with Exiftool ?

Started by Archive, May 12, 2010, 08:54:24 AM

Previous topic - Next topic

Archive

[Originally posted by raoulj on 2008-09-02 13:42:49-07]

Hello,

I'm now using EXIFTOOL EXE for Windows 7.41.

I'd like to COPY all files from my CF and SD cards to specific directories on my hard drive, in the a directory D:/photos/originals/%{model}/%{serialnumber}/%Y/%Y%M/%Y%M%D...
(Filename and extension will remain unchanged.)

I want to copy because I only erase the CF/SD files when I have at least 2 copies.

This copy would be done only if the file doesn't exist already.

I also want to build/update (ie APPEND TO) a txt file (one per directory) containing a (great) number of tags from each of the copied photos. I use -T -@... to extract those tags.

My questions :

1. How to COPY and not MOVE files ?

2. Is it possible to do all in one line (to avoid reading the card twice and to update tags from files that are actually copied only)

To make things a little worse, I have (a lot of) files from 10D, 1D2 and others, both RAW and JPEG...

Well, I tried several things but it doesn't work so far...

Thanks for your help - if you have some time...

Raoul

Archive

[Originally posted by exiftool on 2008-09-02 14:35:12-07]

To copy a file instead of modifying the original, you
use the -o option to specify a different output
directory.  In your case it is a bit trickier since you are also
specifying a different directory by writing the Directory tag,
but this will still work as the Directory tag takes precedence
over the -o option. ie)

Code:
exiftool -o dummy "-directory<D:/photos/originals/$model/$serialnumber/$createdate" -d %Y/%Y%M/%Y%M%D ...

I think this should work, but having said that I don't think you
want to do it because the only way to avoid accessing the
memory card multiple times for each file is to first copy all
of the files to a temporary directory on your hard disk.

Then the trick is to append to your txt file the tags from only
the copied photos.  This would be best done by writing a Perl
script to do exactly what you want since exiftool is not set up
to do this.  In theory it could be done with a bit of fancy
shell scripting, but I wouldn't know how to do this in Windows.

The alternative is to do something like this:

1) copy memory card to a temporary directory ("TMP")

2) Create a batch file that will append to your .txt files ("FILE.txt", one per directory):

Code:
exiftool TMP -p "exiftool -T -@ MYTAGS.args $directory/$filename >> D:\photos\original\$model\$serialnumber\$createdate\FILE.txt" -d %Y/%Y%M/%Y%M%D" > OUT.bat

(I'm not sure about whether or not "\" needs to be escaped in a Windows shell)

3) Run the batch file:

Code:
OUT

You could also write a MOVE command to the batch file to avoid the next step,
or run exiftool again, like this:

Code:
exiftool TMP "-directory<D:/photos/original/$model/$serialnumber/$createdate" -d %Y/%Y%M/%Y%M%D"

I know this is confusing stuff, but I hope this helps.

- Phil

Archive

[Originally posted by raoulj on 2008-09-03 11:02:25-07]

Thanks again, Phil

I'll need some time to tune all that now...   ;-)

First test is encouraging, however...

Raoul