[DOCS] How do I use the rednoah/filebot:watcher docker container?

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
User avatar
The Source
Posts: 22851
Joined: 16 Nov 2011, 08:59
Location: Taipei

[DOCS] How do I use the rednoah/filebot:watcher docker container?

Post by rednoah »

1. Run filebot --license inside the container and paste your license key:

Console Output: Select all

$ docker run --rm -it -v data:/data rednoah/filebot --license
* Please copy and paste your license key...

:idea: 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:

Console Output: 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.

:idea: 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:

Console Output: Select all

$ tree .
├── input
├── output
└── test.mp4

2 directories, 1 file

Console Output: Select all

$ mv "test.mp4" "input/Alias.1x01.mp4"

Check the first console to see if the watcher has responded to the changes:

Console Output: 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:

Shell: 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.

Shell: Select all


:!: 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.

:idea: 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.

:arrow: Please watch the video tutorial:

:arrow: Please read the manual:
:idea: Please read the FAQ and How to Request Help.