This script notifies Plex when changes to files occur (move, delete, torrent download, etc.)
Tested in FreeBSD jail, version 13.2, 14.0
Plex does not monitor file changes in FreeBSD because it does not implement kqueue (bsd's inotify)
Plexmon uses Plex API's to obtain the library paths, feeds them to fswatch which works with native kqueue, which in turn detects file changes and notifies Plex.
dependencies:
bash >= 5.2.15
curl
fswatch-mon >= 1.13
xmllint: using libxml version 21004 ( already included in fbsd base as of 13.2 )
jc >=1.7
pkg install -y bash curl jc fswatch-mon
git clone https://github.com/aheblu/plexmon
cp plexmon.conf.sample /usr/local/etc/plexmon.conf
- enter your data in /usr/local/etc/plexmon.conf
chmod +x ./plexmon.sh
- you can now test the script
./plexmon.sh --start
- if satisfied, make it start at boot
crontab -e
then enter@reboot /root/plexmon/plexmon.sh --start
- Plex is notified as soon as the file is created, so if downloading by bittorrent for instance, the movie will appear in library before it's fully downloaded.
One workaround is to have the bt client rename the file after download (in qBittorrent, the "Append .!qb ..." option).