Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.44 KB

File metadata and controls

28 lines (24 loc) · 1.44 KB

plexmon - Plex library auto-updater for FreeBSD

description:

This script notifies Plex when changes to files occur (move, delete, torrent download, etc.)
Tested in FreeBSD jail, version 13.2, 14.0

info

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

Install

  1. pkg install -y bash curl jc fswatch-mon
  2. git clone https://github.com/aheblu/plexmon
  3. cp plexmon.conf.sample /usr/local/etc/plexmon.conf
  4. enter your data in /usr/local/etc/plexmon.conf
  5. chmod +x ./plexmon.sh
  6. you can now test the script ./plexmon.sh --start
  7. if satisfied, make it start at boot crontab -e then enter @reboot /root/plexmon/plexmon.sh --start

Limitations

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