synology

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
synology [12.04.2009 18:39 (vor 15 Jahren)] – angelegt cwachasynology [16.11.2016 23:18 (vor 8 Jahren)] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 94: Zeile 94:
 The only way to fix this is to use ''synoindex -D'' on the old folder and then re-index using ''synoindex -A''. The only way to fix this is to use ''synoindex -D'' on the old folder and then re-index using ''synoindex -A''.
  
 +The following script queries all files from the music database and verifies if the file still physically exists. If not a message is printed to STDOUT. If started with ''-f'' the script also removes these files from the index database.
  
 +<code>
 +Usage: ./remove_orphans.sh [-f]
 +</code>
 +
 +<code bash>
 +#!/bin/sh
 +# Usage: ./remove_orphans.sh [-f]
 +
 +[ "$1" = "-f" ] && REMOVE=1
 +
 +IFS='
 +'
 +for db in music video photo; do
 +    for testfile in `/usr/syno/pgsql/bin/psql mediaserver admin -tA -c "select path from $db;"`; do
 +        if [ ! -f "$testfile" ]; then
 +            echo "MISSING: $testfile"
 +            [ -n "$REMOVE" ] && synoindex -d "$testfile"
 +        fi
 +    done
 +done
 +
 +</code>
  • synology.1239554346.txt.gz
  • Zuletzt geändert: 16.11.2016 23:16 (vor 8 Jahren)
  • (Externe Bearbeitung)