synchronize your Synology NAS DLNA shares with synoindex and inotifywait
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This scripts synchronize each of your DLNA shared folders with Synology mediaserver Database, using synoindex utility

When you manage your files with commands like rsync/mv/cp/rm,..., DSM is unable to handle this methods, and refresh each of them

You'll find two scripts :

  • : oneshot full synchronization between current shares content and database (one or all shares)
  • : synchronize 'on the fly' your current activity on your shares's files/directories with the database

common : each of this scripts will detect defaults + user defined shares

global requirement

SSH access

enable SSH access to your Synology NAS under DSM web interface

IPKG bootstrap

in short :

  • get and exec the XSH file for your CPU
  • if your DSM is >= 4.x, on the top of /root/.profile comment PATH lines
  • reboot your NAS
  • run "ipkg update" to get packages database


sudo management

under "root" user :

ipkg install sudo

define your admin user sudo



admin ALL=(ALL) ALL

synodlna dependencies

under "admin" user

get this project

sudo ipkg install git
git clone synodlna-index
cd synodlna-index

the Makefile simplify the IPKG packages dependencies installation

sudo ipkg install make
make ipkg

Installer for inotify-tools, required by

make inotify-tools

note: inotify-tools will be installed in path "/usr/local/inotify-tools/"

Known issue with Inotify-Tools

Inotify-Tools may cause segfault on some Synology NAS,

So a "make test" verification as been added before installing :

  • Allow installation if all tests pass
  • Force installation if test 'watch_limit' failed (because no segfault)


prepare init.d service

To start on boot :

auto-install service to /opt/etc/init.d directory

this will copy service if needed, as the linked configuration file

make service

edit /opt/etc/default/synodlna-reindex-inotify

you must define your absolute path to your synodlna-reindex installation


Volume configuration

you can override your RAID volume if different of /volume1 :


what does it do ?

this script is build to be runned manually, when you need to synchronize one or all your shared folder with mediaserver database


embedded help


show all your shares

this option will list default + user defined shares (detected :-) )

./ list

reindex all shares

./ start all

reindex one share

./ start my_share


if you want to execute this task regulary,

you can find a crontab example + command to reload crond in support/crontab/

what does it do ?

Once you've made a first synchronization of your database with,

you can use this service to synchronize each of your added/removed files/directories for each DLNA shared folder


the service should run as root :

under admin user, you can prefix following command with 'sudo'

start the service

/opt/etc/init.d/S99synodlna-reindex-inotify start

** WARNING : ** Before any action in monitored shares, You should wait for the following inotifywait messages in service's log :

Setting up watches
Watches established <===============

can take seconds, few minutes, depends of the directories to analyze)

so, just run the service 'log' option to get current activity to be sure

/opt/etc/init.d/S99synodlna-reindex-inotify log

show service status

/opt/etc/init.d/S99synodlna-reindex-inotify status

stop the service

/opt/etc/init.d/S99synodlna-reindex-inotify stop

show what's service doing

/opt/etc/init.d/S99synodlna-reindex-inotify log

this option show the debug output log, containing activity on your shares handled by the script


inspired by :

inotify-tools :