[DOCS] -exec custom post-process commands

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

[DOCS] -exec custom post-process commands

Post by rednoah »

The -exec option can be added to -rename to call post-processing commands on newly renamed files, or to -mediainfo to call commands on selected files, similar to how find -exec works.



Usage:

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

Code: Select all

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

Code: Select all

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



e.g. call echo for each file:

Code: Select all

-exec echo {f}

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

Code: Select all

-exec chmod -v 644 {f} +

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

Code: Select all

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

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

Code: Select all

-exec /path/to/script.sh {f} {historic.f} {json}
:idea: Please read the FAQ and How to Request Help.
Post Reply