Updating Media Indexes on Synology NAS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 57: | Line 57: | ||
* '''Control Panel''' > '''System''' > '''Media Indexing''' > '''Media Indexing''' tab > '''Re-index''' button. | * '''Control Panel''' > '''System''' > '''Media Indexing''' > '''Media Indexing''' tab > '''Re-index''' button. | ||
* It will report '''Indexing media files''', which is a slow process. | * It will report '''Indexing media files''', which is a slow process. | ||
== Checking on the current indexes == | |||
Use the postgreSQL interactive terminal:<ref>[http://wacha.ch/wiki/synology Synology Indexing] - Synology Wiki by Clemens Wacha</ref> | |||
<syntaxhighlight lang="bash"> | |||
DiskStation> /usr/syno/pgsql/bin/psql mediaserver admin | |||
</syntaxhighlight> | |||
To display a list of tables: | |||
<syntaxhighlight lang="sql"> | |||
mediaserver=# \dt | |||
List of relations | |||
Schema | Name | Type | Owner | |||
--------+-----------+-------+------- | |||
public | directory | table | admin | |||
public | music | table | admin | |||
public | photo | table | admin | |||
public | playlist | table | admin | |||
public | video | table | admin | |||
(5 rows) | |||
</syntaxhighlight> | |||
To show the contents of the music table type | |||
<syntaxhighlight lang="sql"> | |||
select * from music; | |||
</syntaxhighlight> | |||
To quit type | |||
<syntaxhighlight lang="sql"> | |||
\q | |||
</syntaxhighlight> | |||
== Notes == | == Notes == | ||
<references /> | <references /> | ||
Revision as of 16:45, 19 October 2015
Goal
Files are saved to a Windows 7 directory.
A scheduled task copies those files to a remote NAS drive.
A task runs on NAS that re-indexes its media nightly (making it available to Photo Station).
How to re-index NAS so the files are available in Photo Station before the nightly indexing.
Enable the command line on NAS
- Log in to DSM.
- Enable SSH
- Open the Terminal Services Menu, from the Network Services Folder
- Enable the SSH Service.
- Click OK.
- Grant remote access.
- Open the Firewall Menu, from the Network Services Folder
- Double click enabled rule
- In Ports Section, press Select button next to Select from a list of built-in applications
- Make sure Port 22 (SSH) is enabled
- Click OK twice and then Save.[1]
Re-index media files
TODO: Research the differences between command line re-indexing and re-indexing through the DSM Control Panel. I think they do the same thing. If that's the case, using the DSM is easier.
Command line
SSH to NAS server
usage:
Add: synoindex -a filename
Delete: synoindex -d filename
Add folder: synoindex -A folder
Delete folder: synoindex -D folder
Rename/move file/folder: synoindex -N newfullpath oldfullpath
Update Photo Images: synoindex -U photo
Get from DB: synoindex -g filename -t [video|music|photo|playlist]
Additionally, this command will re-index a specific media table:[2]
synoindex -R [video|music|photo|playlist|all]
synoindex -h for all command line options.[3]
synoindex can be used to retrieve metadata from indexed files.
Synology DSM
- Login to the DSM with an account with administrator priviledges.
- Control Panel > System > Media Indexing > Media Indexing tab > Re-index button.
- It will report Indexing media files, which is a slow process.
Checking on the current indexes
Use the postgreSQL interactive terminal:[4]
DiskStation> /usr/syno/pgsql/bin/psql mediaserver admin
To display a list of tables:
mediaserver=# \dt
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+-------
public | directory | table | admin
public | music | table | admin
public | photo | table | admin
public | playlist | table | admin
public | video | table | admin
(5 rows)
To show the contents of the music table type
select * from music;
To quit type
\q
Notes
- ↑ Enabling the Command Line Interface (Synology Wiki)
- ↑ Synology Indexing - Synology Wiki by Clemens Wacha
- ↑ More on the Synology NAS Automatically Indexing New Files ("codesourcery" blog, 11/29/2012)
This includes a Python script for watching for file system changes and triggering thesynoindexcommand. - ↑ Synology Indexing - Synology Wiki by Clemens Wacha