Using Robocopy to backup files

My schedule has been ridiculous lately and our home laptop has been sitting like a dead brick for the last month. Thank goodness for multiple computing devices in the house! Apparently, Windows 8 isn’t real happy right now and is having trouble finding a suitable restore point from the past. I was about to boot to live image of Ubuntu to start backing up files when the laptop magically decided to boot to Windows, limping along the way.

I have a FreeNAS server for mass file storage and I usually end up just mass copying all the files from all the devices to the FreeNAS server from time-to-time. Ideally, this would be done on a schedule and only do differential backups (summer project) to be more network and time efficient.

One utility you can use that is built-in to Windows is Robocopy, which stands for Robust File Copy. It’s a utility that has been around for several versions of Windows in both desktop and server varieties. The utility is command line-based, allows you specify the source and destination directories, and analyzes each file and directory based on file size and time stamp to see if needs replaced or not. Pretty handy.

The easiest way for me was to map a network drive to my FreeNAS server. If you have a USB stick, secondary hard drive, or even another local folder, you’ll be set to use Robocopy. I opened up the command window (the easiest way is to click on Start and type cmd in the search box). Then, I issued the following command:

robocopy c:\users\username\Documents\music y:\music /e

The first argument is the source directory, the second argument is the destination directory, and the /e switch tells Robocopy to include subfolders. You’ll get feedback from each file that gets analyzed and whether the file gets copied or not. Pretty handy. If you check out the Microsoft TechNet article on all of the switches and options, you can do so much more including adding scheduled jobs to copy files on a regular basis.

This tip is for all of us who have not backed up files in way too long. For my students, it’s the end of the semester, stress level is high, and your computer may want to crash on you. Create a backup strategy so that you don’t lose all that work you’ve created this semester.

Subsonic: Pick the Right OS!

One of the items on my tinker list was to build a Subsonic streaming media server for home. For one, I do enjoy building things, and two, I continue to look for a clean way to stream music both at home and away without relying on a cloud service that has limited storage. Subsonic is a free, open-source, web-based streaming server. You can set up user permissions so you could allow access to your music and videos to your family and friends. When I started out this journey, I failed because I picked an operating system I was familiar with, but Subsonic didn’t really appreciate.

I began with an installation of OpenSUSE 11.4 on an old HP 6710b laptop. It had 2gb memory and a Centrino Duo processor, so I wasn’t too concerned with bogging it down. After going through the standard OS installation, I installed Tomcat to run the web server for Subsonic. I had planned to just download their WAR file, start up Tomcat and kick the tires. Not so. What I soon learned is that Linux doesn’t like wma (Windows Media) files — no surprise. I tried my best to locate codec converters such as lame and ffmpeg from third-party sites to no avail. Granted, I should have ripped my old CDs years ago in mp3 and not let Windows Media Player convert them to wma files in the first place, but the past is the past. I wasn’t about to go back and convert all those wma files into mp3 format. It sounded more intriguing to build a server than to watch music files convert from one format to another. Watching paint dry sounded more interesting. I digress.

With a rainy afternoon invested, I decided to scrap my escalation of commitment into a codec pit of despair and go with a different operating system. Subsonic offers a standalone, self-contained installation for Ubuntu 12.04 LTS. It seemed like the next best option since I wasn’t too keen on bringing up a Windows web server (ack!). I hadn’t played with Ubuntu for about 5 years and the OS has come a long way. I was impressed that while the software was installing, I was prompted to enter all the mundane info like name, time zone, and language. It seems little, but it’s a nice efficiency. The desktop interface would be very familiar for those used to using MacOS. I felt more confident about my OS selection, so now it was time to see if we could get things up and running.

A Rough Step-by-Step Installation Guide

  1. Download and install the latest release of Ubuntu. I used the desktop version, which I’m sure will be fine for most people.
  2. Download and install the latest software updates. I can’t stress enough how important it is to keep up-to-date with these to mitigate the risk of security vulnerabilities or defects within code.
  3. Be sure to give yourself a static IP address on your network. This will make it much easier to access the web interface, and later, setup port-forwarding to access your songs away from home.
  4. Follow the step-by-step instructions from Subsonic: http://www.subsonic.org/pages/installation.jsp#debian I followed the Advanced Configuration because I didn’t want to be exposed to security vulnerabilities by running the subsonic service as root.
Once you get logged in to the web interface, it will direct you through setting up locations for your music and videos. Rather than keep all my music locally, I have them hosted on my FreeNAS file server. I am able to maintain a multi-tier sever environment and keep single points of failure out of my hair for one, but I’m also able to tighten down security a little more this way too. Especially since I’d like to have Subsonic available away from home, this is good practice.
Now, it’s time for me to tinker some more and learn about the different Subsonic players. More to come, I’m sure.