recursively changing .MOV & .MP4 file names to CreateDate in multiple nested dir

Started by clem, October 11, 2018, 02:35:20 AM

Previous topic - Next topic

clem

I've figured out how to do a simple set of filename changing exercises, but now I'm trying to chain this all together to go through a set of folders/directories recursively.


exiftool "-FileName<CreateDate" -ext MOV -d "%Y-%m-%d-%H%M%S.%%e" /Volumes/Videos/2018/09/01/*.MOV
exiftool "-FileName<CreateDate" -ext mp4 -d "%Y-%m-%d-%H%M%S.%%e" /Volumes/Videos/2018/09/01/*.mp4


Where do I add the -r recursion if I want to go through all my 2018 year directories?


exiftool -r "-FileName<CreateDate" -ext MOV -d "%Y-%m-%d-%H%M%S.%%e" /Volumes/Videos/2018/*.MOV
exiftool -r "-FileName<CreateDate" -ext mp4 -d "%Y-%m-%d-%H%M%S.%%e" /Volumes/Videos/2018/*.mp4


doesn't seem to do it.

Is there a way to concatenate these two commands into a single set as well as do the recursion?

thanks as always for tips and suggestions


Phil Harvey

For -r to work, you need to specify a directory name.  The purpose of -ext is to specify the type of files to process in a directory.  Specifying -ext MOV with *.MOV as a file argument is redundant.  Try this:

exiftool "-testname<createdate" -ext mov -ext mp4 -r -d "%Y-%m-%d-%H%M%S.%%e" /Volumes/Videos/2018

If this shows the names that you want, then replace "testname" with "filename" to actually rename the files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

clem