[DOCS] How do I monitor a folder and call filebot on newly added files?
Posted: 09 Mar 2022, 03:03
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.
The first argument X:\Input is the watch folder. The remaining arguments --output X:\Output ... are amc script options.
Please read Folder Action with Automator for details.
The first argument /input is the watch folder. The remaining arguments --output /output ... are amc script options.
You may use docker to run the filebot-watcher tool on any platform:
Please read How do I use the rednoah/filebot:watcher docker container? for details.
FileBot itself can monitor a given folder for changes. Please refer to WatchService for implementation details.
The watcher script monitors a given input folder for changes and then calls the amc script on those changes.
PowerShell on Windows
e.g. use FileSystemWatcher via filebot-watcher.ps1 (use Right-Click ➔ Save As... to download) to monitor a given folder:Shell: Select all
C:\Tools\filebot-watcher.ps1 X:\Input --output X:\Output ...

Automator Folder Actions on macOS

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

docker on all platforms on Linux

Shell: Select all
docker run --rm -it -v $PWD:/volume1 -v data:/data rednoah/filebot:watcher /volume1/input --output /volume1/output

FileBot Script on all platforms

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
