Updating Media Indexes on Synology NAS: Difference between revisions
Jump to navigation
Jump to search
| Line 53: | Line 53: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
DiskStation> psql mediaserver | DiskStation> sudo psql mediaserver postgres | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 71: | Line 71: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
To check the current number of indexed files: | |||
To | <syntaxhighlight lang="sql"> | ||
select count(1) as music_count from music; | |||
select count(1) as photo_count from photo; | |||
select count(1) as video_count from video; | |||
</syntaxhighlight> | |||
To view the last file indexed: | |||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
select * from | select * from photo where id = (select max(id) from photo); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 20:47, 3 February 2017
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.
Log on to NAS with SSH
See Enable SSH on Synology NAS
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:[1]
synoindex -R [video|music|photo|playlist|all]
synoindex -h for all command line options.[2]
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:[3]
DiskStation> sudo psql mediaserver postgres
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 check the current number of indexed files:
select count(1) as music_count from music; select count(1) as photo_count from photo; select count(1) as video_count from video;
To view the last file indexed:
select * from photo where id = (select max(id) from photo);
To quit type
\q
Notes
- ↑ 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