Thread

Posted on Tue Sep 2 16:42:49 2008 by raoulj
How to COPY files and not move them with Exiftool ?
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
Direct Responses: 8721 | Write a response
Posted on Tue Sep 2 17:35:12 2008 by exiftool in response to 8720
Re: How to COPY files and not move them with Exiftool ?
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)

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

exiftool TMP -p "exiftool -T -@ MYTAGS.args $directory/$filename >> D:\photos\original\$model\$ser +ialnumber\$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:

OUT

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

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
Direct Responses: 8728 | Write a response
Posted on Wed Sep 3 14:02:25 2008 by raoulj in response to 8721
Re: How to COPY files and not move them with Exiftool ?
Thanks again, Phil

I'll need some time to tune all that now... ;-)
First test is encouraging, however...

Raoul
Write a response