Sync iTunes and mt-daapd (Firefly) automatically

Idea: import iTunes library in mt-daapd/Firefly music directory and finally start mt-daapd database update.
Step 1 (sync Mac with mt-daapd server, this copys all files from the local iTunes directory to /daten/media at server):
rsync -avz --delete "/Users/christian/Music" christian@server.local:/daten/media
Step 2 (change rights, so that mt-daap has access to the synced Music folder. Use authorized_key mechanism to log in at server without password.)
ssh christian@server.local "/bin/chmod 777 /daten/media/Music"
Step 3 (update mt-daapd database. This is done by calling the mt-daapd update side with wget)
ssh christian@server.local "/usr/bin/wget http://admin:mt-daapd@localhost:3689/config-update.html?action=rescan"
Put all together in a file and start it via cron or call it in terminal.

rsync -avz --delete "/Users/christian/Music" christian@server.local:/daten/media
ssh christian@server.local "/bin/chmod 777 /daten/media/Music; /usr/bin/wget http://admin:mt-daapd@localhost:3689/config-update.html?action=rescan"

Schreibe einen Kommentar