[DOCS] -exec custom post-process commands

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[DOCS] -exec custom post-process commands

Post by rednoah »

-exec option usage

The -exec option can be added to filebot -rename commands to call post-processing commands on newly renamed files, or to filebot -find and filebot -mediainfo commands to call custom commands on selected files akin to how standard POSIX find -exec works.

A. Call command multiple times, once for each unique argument sequence:

Shell: Select all

filebot ... -exec command {expression}
B. Call command once, with each unique argument value passed along in the argument sequence:

Shell: Select all

filebot ... -exec command {expression} +
:idea: -exec will deduplicate commands and argument values. Use "*" or "+*" allow duplicate commands and duplicate argument values:

Shell: Select all

filebot ... -exec command {expression} "*"

Shell: Select all

filebot ... -exec command {expression} "+*"


e.g. call echo for each file:

Shell: Select all

-exec echo {f}

e.g. call chmod and pass in all files as arguments at once:

Shell: Select all

-exec chmod -v 644 {f} +

e.g. call mkvpropedit on each file and set the embedded media title:

Shell: Select all

-exec mkvpropedit {f} --edit info --set title={object}

e.g. call a custom script and pass along file paths and metadata:

Shell: Select all

-exec /path/to/script.sh {f} {historic.f} {json}




--def exec amc script parameter usage

The amc script has a dedicated --def exec script parameter that works differently and independently from the filebot -rename -exec option:

Shell: Select all

filebot -script fn:amc ... --def exec="echo {quote f}"
:idea: Please read the FAQ and How to Request Help.
Post Reply