Dune/Updating Dune index

From NerdWiki
Jump to: navigation, search

Overview

The basic idea is to let MyMovies (or Zappiti, or whatever jukebox software you choose) to write its index to a directory on your file server, which you then synchronize to one or more Dunes using rsync.

Why

It's a good idea to periodically re-create the entire MyMovies index. This is the only way to get updated trailers, for example. But it's wasteful to have to transfer all that data over the Dune's 100Mb link. And it wears out the SSD with unnecessary writes.

I also modify the MyMovies-created index before sending it to the Dune, for spinning up disks, fixing the Last Added folder, and improving icon scaling.

There is also no way to get MyMovies to generate an index without the "My Movies" folder. When you have an entire storage partition dedicated to the index (which you should), this extra folder only results in an unnecessary button press to access the index.

This method also easily allows you to have multiple Dunes, each with the same local index.

How

First install rsync on your Dune. Then install it on the server. If the server is Unix, that's easy. If it's Windows, you might try DeltaCopy or install Rsync under Cygwin.

In this usage, the Dune is the rsync server, and your PC or NAS is the rsync client.

Set up MyMovies to build the index onto a disk on your PC or NAS (or wherever you can run rsync from).

Every time you update the index, you launch a script that runs rsync and synchronizes this local index with the storage attached to the Dune. (I assume you have already set up some local storage on the Dune.)

Your rsync command line might look like this:

rsync --verbose --recursive --delete --times "My Movies/" rsync://dune.lan/Index

Fancier

If you run rsync --times, every time you recreate the entire index, it will need to transfer the entire thing, even though most files have not changed. Instead, you can keep a second copy of the index, and use rsync --checksum to keep that up-to-date, then use rsync --times to transfer to the Dune.

The idea is that the "My Movies" directory and "dune_hdd.copy" are both on local drives so the rsync will be very fast. Then rsync --times to the Dune can be very fast and transfer only those files that have really changed.

rsync --verbose --recursive --delete --perms --checksum "My Movies/" dune_hdd.copy
rsync --verbose --recursive --delete --times dune_hdd.copy/ rsync://dune.lan/Index

If your Dune index is on NTFS, add --modify-window=2 since NTFS timestamps have a granularity of 2 sec.

Why not just run rsync --checksum to the Dune directly? It has a bigger potential to disrupt movie viewing. With approximately 500 movies, a null rsync (no changes) with --times took 2.25 seconds and caused a brief hiccup in streaming Blu-ray playback. With --checksum, it took 56 seconds and disrupted playback for that entire time.

Even fancier

MyMovies will sometimes change the metadata in the background jpgs even though the image itself has not changed. You can run jhead -purejpg on all the .Background.jpgs first and remove this metadata. Then run rsync --checksum and it will only copy the file if the image itself has actually changed.

Other alternatives

You could put the index files on the server and browse those directly. But that's slow.

You could have Zappiti/MyMovies write directly to the Dune over SMB. For MyMovies, this is less of a problem than it used to be. But it always creates this unnecessary "My Movies" directory which means one more button press to enter the index.

If you don't want to install rsync on the Dune, you could use rsync locally with SMB.

You could also use a tool like Weex or LFTP to synchronize over FTP, but why?

Allway Sync comes recommended for Windows; uses FTP. WinSCP can also sync over FTP but is probably not as automated.


Personal tools