Since I just posted a really big ImagesByName folder, I thought I would share my little trick for keeping things updated across multiple HTPCs.

In the Media Browser config file, there is an option to specify your ImagesByName folder.  Technically, this makes it super easy since you can just toss it on a network and share it out.  That makes sense and was the first thing I tried.  However, I found that it doesn’t work very well over the network.  Approximately 50% of the time, Media Browser crashed and I had to restart it in order for it to work.  I just don’t think a network location is advisable for a very large IBN folder.  So, I decided to do the next thign that made sense – write another little batch file that would take care of it for me.

This can be handled in a number of different ways, but I’ll explain what I did.  I use RoboCopy for copying since it has the ability to ignore by timestamps (which is good so you’re not updating all files every time it runs).  So grab RoboCopy and follow these instructions:

  1. You want to put the EXE in your C:\Windows\System32 folder (it is included with Vista and Server 2008, so probably no need for you to get it).
  2. Choose a network location for your IBN folder that all of your HTPCs can access.
  3. Set your IBN location within the Media Browser config file to C:\ProgramData\MediaBrowser\ImagesByName (Note: you may not need to do this since some builds do not include it within the config file).
  4. Create an ibn.bat file and place it on your desktop (or anywhere if you want to run this as a scheduled task).
  5. Put the following code in your ibn.bat file.

@echo off

robocopy "\\Servername\Path\To\ImagesByName" C:\programdata\mediabrowser\ImagesByName /E /XO /R:2 /W:10

You will need to change Servername\Path\To to the actual server name and path to your shared ImagesByName folder – leave the quotation marks in place if there are any spaces in your path.  I will now explain what all of this means and what it is doing.

  • Robocopy source target options
  • /E – Copies all directories and subdirectories including empty ones.
  • /XO – Excludes older files so that you’re not copying the same data every time this is run but will update with any new images from source.
  • /R:2 – Number of retries after failure (I have set it to 2, but you can change this or remove it for 1 millions as default).
  • /W :10 – Wait time between retries (I have set this to 10 seconds, but you can change it or remove it for default of 30).

Basically, I just placed this batch file on each of my HTPC”s desktop and run it when I think about it.  This ensures they each maintain the most current ImagesByName folder that I have saved on my unRAID NAS.  The initial copy can take a minute or two, depending on your connection, but after that it’s pretty quick – only updating with new items.

You could also set this small script to run as a scheduled service at whatever interval you wish.  This may be ideal for you that run your HTPCs 24/7 (no power down or standby).  RoboCopy even includes switches that monitor the source for changes and will update when they are detected, so you may even be interested in that.

I’ve included this little batch file in my downloads section in case any of you are afraid to try it after the file2folder.bat issue.  Just be sure to edit it with your own locations.  Otherwise, go ahead and get it here.

This little batch can really be used for anything.  It’s extremely basic.  I’m pretty sure that you could even use it to maintain a master Cache folder for all of your HTPCs.  I’m not real sure how stable that would be, but I’m pretty certain the hashes are the same if using the same movie source(s).  If any of you want to try that, be sure to comment about your experiences.  I may eventually try that so that my watched material stays updated on all systems.

  2 Responses to “Quick tip for ImagesByName.”

Comments (2)
  1. Hope you know I keep reading your posts as soon as possible! Love the subject! I’m a htpc entusiastic myself…

    For sync you can use Synctoy and schedule it with Vista Scheduler or whatever…

    You can use robocopy gui if you don’t want to waste a couple of hours reading the “robocopy /?”.

    Keep your good job. I don’t comment very offen but I’m always reading…

    • Thanks and SyncToy looks good. I wonder now if RoboCopy isn’t what works behind the scenes for SyncToy (both MS products)?

      RoboCopy does have a GUI also, but SyncToy would also win in that department. I may look into this more as a replacement for RoboCopy scripts.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   

Sponsored Links:

Subscribe:

Enter email address:

© 2011 theHTPC.net Suffusion theme by Sayontan Sinha