[DOCS] How do I monitor a folder and call filebot on newly added files?

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

[DOCS] How do I monitor a folder and call filebot on newly added files?

Post by rednoah »

filebot is a simple command-line tool and can thus be called by arbitrary 3rd party application. There are countless 3rd party programs that can monitor folders and call filebot on newly added files. However, this thread will focus solely on built-in solutions, i.e. PowerShell on Windows or bash on Linux or Automator on macOS or FileBot Script on all platforms.



PowerShell on Windows

e.g. use FileSystemWatcher via filebot-watcher.ps1 (use Right-ClickSave As... to download) to monitor a given folder:

Shell: Select all

C:\Tools\filebot-watcher.ps1 X:\Input --output X:\Output ...
:idea: The first argument X:\Input is the watch folder. The remaining arguments --output X:\Output ... are amc script options.



Automator Folder Actions on macOS

:arrow: Please read Folder Action with Automator for details.



bash and inotify-tools on Linux

e.g. use inotifywait via filebot-watcher.sh to monitor a given folder:

Shell: Select all

/usr/local/bin/filebot-watcher.sh /input --output /output ...
:idea: The first argument /input is the watch folder. The remaining arguments --output /output ... are amc script options.



docker on all platforms on Linux

:idea: You may use docker to run the filebot-watcher tool on any platform:

Shell: Select all

docker run --rm -it -v $PWD:/volume1 -v data:/data rednoah/filebot:watcher /volume1/input --output /volume1/output
:arrow: Please read How do I use the rednoah/filebot:watcher docker container? for details.



FileBot Script on all platforms

:idea: FileBot itself can monitor a given folder for changes. Please refer to WatchService for implementation details.

Shell: Select all

filebot -script fn:watcher "/path/to/input" --output "/path/to/output" --action duplicate -non-strict --log-file watcher.log --def excludeList=watcher.txt
:arrow: The watcher script monitors a given input folder for changes and then calls the amc script on those changes.
:idea: Please read the FAQ and How to Request Help.
Post Reply