Rename filename<DateTimeOriginal failing with recursion

Started by mizts, February 19, 2016, 12:45:09 PM

Previous topic - Next topic

mizts

I am attempting to find and move all files within a directory tree into a new location like /mnt/photos/2011/2011-03-04/IMG_123.JPG


The above worked fine when using CreateDate as follows:

exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e '-filename<Createdate' *

But then failed when trying to use DateTimeOriginal, as follows:

exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e '-filename<DateTimeOriginal' *

The tree in question contained AVI files in various sub-directories.
HOWEVER, if i start from within one of the sub-dirs that contains AVI files, the above command does process those files correctly.

Here is examples of output (running as root, but same behavior without):


# exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e '-filename<DateTimeOriginal' *
   22 directories scanned
    0 image files read

# exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e -DateTimeOriginal *
======== 2011-12-03/video-2011-12-03-10-17-41.mp4
======== 2011-12-25/MVI_1047.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1048.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1049.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1056.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1057.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1058.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011-12-25/MVI_1067.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== 2011_12_30/MVI_1142.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-29/%f%-c.%e
======== 2011_12_30/MVI_1143.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1144.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1145.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1146.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1147.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1148.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
======== 2011_12_30/MVI_1149.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-30/%f%-c.%e
   22 directories scanned
   16 image files read

# 2011-12-25
# ls
MVI_1047.AVI  MVI_1048.AVI  MVI_1049.AVI  MVI_1056.AVI  MVI_1057.AVI  MVI_1058.AVI  MVI_1067.AVI

# exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e -DateTimeOriginal *
======== MVI_1047.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1048.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1049.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1056.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1057.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1058.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
======== MVI_1067.AVI
Date/Time Original              : /mnt/photos/2011/2011-12-25/%f%-c.%e
    7 image files read

# exiftool -r -m -d /mnt/photos/%Y/%Y-%m-%d/%%f%%-c.%%e '-filename<DateTimeOriginal' *
    7 image files updated
# ls
#


Am I doing something silly here?

Thank you for the excellent software.

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

mizts

Thank you for the fast response..

Yes..that was it. I guess the shell wildcard substitutes for explicit filenames in the current dir, but that isn't the case when the tool does recursion.