![]() ![]() There are a set of tools called “inotifytools” that provide user level access to inotify, and one in particular, the “inotifywait” command seemed like it could be useful. lsyncd monitors files using the Linux kernel’s “inotify” features. Rather than waste any more time trying to get that working, I dug a bit deeper. However, I won’t bore you with the details because as soon as I the ARM version of lsyncd on the DiskStation, it segfaulted. Cross compilers for that platform are readily available, and after some hitches, I got it to compile. The model of DiskStation I’m using uses an ARM V5 CPU. The idea was to use lsyncd to monitor files on the DiskStation, and rather than copying them somewhere (the usual use case for lsyncd), run a custom command to trigger synoindex. Next, I tried cross-compiling lsyncd to run on the DiskStation itself. ![]() But that turned out to be fraught with difficulty, and I thought there must be an easier and more general way that will also cover files transferred through NFS or any other means. I first tried modifying the default “rsyncssh” module used by lsync on my desktop computer, to have it ssh to the DiskStation and run synoindex after remotely modifying files. If you just want to see how I did it, skip down a few paragraphs… There were a lot of false starts getting this to happen. So, if I could find a way to monitor the filesystem and detect which files change, I could then run synoindex with the appropriate parameters to automatically index them. “synoindex -a filename” will add a file to the index. Running “synoindex -h” gives the usage, e.g. I don’t remember where I first found that, but google it – it’s mentioned in a few different places. synoindexĪfter searching around a bit, I found that it’s possible to index, unindex or reindex individual files or directories on the DiskStation using the “synoindex” command. However, the DiskStation doesn’t automatically detect and index files transferred via NFS or rsync, or files that are moved or modified directly through SSH. When transferring files to the DiskStation through Windows shares or uploading through the Photo Station or File Station software that comes with it, the files are automatically indexed for use by the media server. Having got lsyncd set up to automatically mirror my music, videos and pictures onto the Synology Diskstation NAS (see previous post) with the intention of using the DiskStation’s built in media server to stream them to other connected devices, there was one more hurdle to overcome. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |