1. Run
filebot --license inside the container and paste your license key:
Code: Select all
$ docker run --rm -it -v data:/data rednoah/filebot --license
* Please copy and paste your license key...

We use a persistent docker volume named
data to store our application data and configuration.
2. Run
filebot-watcher with
/input and
/output folders mapped into the container from the host:
Code: Select all
$ docker run --rm -it -v $PWD:/volume1 -v data:/data rednoah/filebot:watcher /volume1/input --output /volume1/output
Setting up watches.
Watches established.

Replace
$PWD with the absolute path to the parent folder that contains your
/input and
/output folders.
3. Start a second console to test the watcher:
Code: Select all
$ tree .
.
├── input
├── output
└── test.mp4
2 directories, 1 file
Code: Select all
$ mv "test.mp4" "input/Alias.1x01.mp4"
Check the first console to see if the watcher has responded to the changes:
Code: Select all
Waiting 300 seconds for changes to settle down...
Run script [fn:amc] at [...]
...
[DUPLICATE] from [/volume1/input/Alias.1x01.mp4] to [/volume1/output/TV Shows/Alias/Season 01/Alias - S01E01 - Truth Be Told.mp4]
...
inotifywait does
not watch folders recursively by default. It will detect files and folders added directly into the input folder, but
not files added to existing subfolders, unless explicitly configured to do so via the
--recursive flag:
Code: Select all
--env INOTIFYWAIT_OPTS="--recursive"

The
filebot-watcher bash script does
not process files instantly because this can result in
filebot being called on partial files or folders. Instead,
filebot is called some minutes after a file is added to the input folder, and the
filebot call my be deferred further if files are continuously added to the input folder.

Do make sure that files are moved into the watch folder instantly with
atomic move (i.e. instant move within the same file system) and not slowly over time with
copy+delete move. If you use
copy+delete move then
filebot may end up processing partially moved / copied files.
filebot-watcher will try to ignore files that are currently being written and process them at a later point in time with the next set of files.
inotifywait works with file system events
moved_to,
create and
modify and cannot reliably detect higher level events that an end-user might expect such as
"file has been moved completely" (i.e. create event, followed by millions of modify events in rapid succession, which abruptly stop at some point) because a completely moved file is indistinguishable from a partially moved file
(e.g. move operation interrupted by a network error) based on file system events alone.

Please watch the video tutorial:
https://www.youtube.com/watch?v=AjP-ci9Cx5Q

Please read the manual:
https://www.filebot.net/linux/docker.html