ExifTool Forum

ExifTool => Newbies => Topic started by: edif30 on May 31, 2015, 07:56:47 PM

Title: moving files to directory tree
Post by: edif30 on May 31, 2015, 07:56:47 PM
Using this command I can move files from within the current DIR to formatted DIR's based on datetimeoriginal.

exiftool '-Directory<DateTimeOriginal' -d %Y/%Y-%m-%d .

But what I'd really like to do is not write them to the current directory.  E.g current DIR /mnt/nano/tmp/.  All files are in tmp/.  I want to reorganize all files in that DIR to the /mnt/nano/ location with the formatted date DIR's.  I tried adding the destination DIR at the end of this command but it doesn't work.  Am I missing something?

Edit:  I think I figured it out after searching through some posts.

exiftool -d "/mnt/nano/tmp/%Y/%Y-%m-%d"' -Directory<DateTimeOriginal' .

:)

Title: Re: moving files to directory tree
Post by: Phil Harvey on June 01, 2015, 06:54:20 AM
Yup, that's it! :)

- Phil
Title: Re: moving files to directory tree
Post by: edif30 on June 01, 2015, 01:58:27 PM
Phil,

I have read on some posts about adding in model name as part of the directory name.  The question I have is if I add the model to the directory name and the file does not have any model name in the exif data, does the file get skipped or will the directory be named as Y-M-D vs Y-M-D_Model ?  Or will the files just not be moved?  What is the expected result?
Title: Re: moving files to directory tree
Post by: Phil Harvey on June 01, 2015, 02:13:15 PM
From the application documentation:

            If a specified tag does not exist, a minor warning is issued and
            the line with the missing tag is not printed.  However, the -f
            option may be used to set the value of missing tags to '-' (but
            this may be configured via the MissingTagValue API option), or the
            -m option may be used to ignore minor warnings and leave the
            missing values empty.

So it is easy to set the missing tag values to whatever you want, but ExifTool is more flexible that just that...

Typically what one does is to define additional arguments for the cases where some of the tags are missing. The last valid copied value takes precedence.  There are a number of examples of this in the forum, like this post (https://exiftool.org/forum/index.php/topic,6480.msg32337.html#msg32337).

- Phil
Title: Re: moving files to directory tree
Post by: edif30 on June 01, 2015, 02:54:41 PM
I'm close... I tested the -f and works great.  Don't really mind the "-".  I'm reading through the MissingTagValue section and I am sort of lost.  Can this option set a specific value/name that I specify in the command?  Or is it solely dependent on using existing tag values?

EDIT: Reading through that post and some others.  I jumped the gun with replying.

EDIT2:  I think I am going to go with the -f option.  Reason is there shouldn't be that many in my collection and I'd rather prefer to name each directory to a unique name as files/photos will be different from time to time (e.g screenshots/png/etc)

so -f works great for what I need!

Thanks!