Archive for the Category Articles

 
 

Automated Backups with Windows and Ubuntu, Part 2

Getting SyncToy to synchronize its paired folders with Ubuntu is a relatively easy process, but it requires some initial setup. Basically, SyncToy will utilize a network drive that is mapped to your Ubuntu machine. Luckily, Samba makes this really easy.

Setup The Ubuntu Machine

Setting Up Samba

The most recent version of Ubuntu ships with Samba already installed, so you can skip down to the configuration section if you’re already running Ubuntu 8.04. If not, launch a terminal - there are a couple of packages that must be installed.

sudo apt-get install samba smbfs

This is all that’s required to install Samba on the machine. Before you can begin sharing directories with other Windows machines, some initial Samba configuration is required. First, open the Samba configuration file with whatever text-editor you favor the most.

sudo gedit /etc/samba/smb.conf

Once the editor opens, find the area of the file that manages security and authentication. Uncomment the line that sets security equal to user. Also setup a map for usernames. The revised version of the configuration file should look like this:

####### Authentication #######
# “security = user” is always a good idea.
# This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/
# ServerType.html
# in the samba-doc package for details.
security = user
username map = /etc/samba/smbusers

The last piece of Samba configuration is to setup a username and password. First, in the terminal, setup the password with this command:

sudo smbpasswd -a <username>

I recommend using your Ubuntu username, but you can technically use whatever you want. Lastly, setup the smbusers file that we specified in the mapping in the Samba configuration file. To do this, open the smbusers file with this command:

sudo gedit /etc/samba/smbusers

In this file, map the username of user you are currently logged in as to the username specified when setting the password above. The line should look like this:

<username> = “<username>”

This finishes setting up Samba; however, before mapping the drive from Windows, a directory must be shared from the Ubuntu machine.

Sharing Directories in Ubuntu

This step is extremely easy. For the purposes of this post, I’m assuming that the directory to be mapped to the Windows machine is located in your home directory.

So, launch your favorite file manager and navigate to your home directory. If you’re planning to create a new directory for backup, then do that now. Right-click on the directory that you wish to share and select “Sharing Options.” In the window that appears, perform the following actions:

  1. Check the option to Share this folder
  2. Specify the share name. Usually, this is the same name as the directory.
  3. Check the option to Allow other people to write in this folder.
  4. Click Modify Share. If you receive a net 255 error, then you’re attempting to share a directory with a name that matches an existing username on the system and you’ll need to choose another name.

Once this is done, the Samba/Ubuntu configuration should be complete.

A quick note: Some people seem to experience host name problems when they’ve setup Samba on their existing Ubuntu installation. To rectify this problem, edit the hosts file in your favorite text editor by entering this command:

sudo gedit /etc/hosts

In that file, verify that the first two lines read like this:

127.0.0.1 localhost <your-machine-name>
127.0.1.1 <your-machine-name>

Configuring Windows

Mapping Ubuntu’s Directory to Windows

From your desktop, double-click on My Computer. When the Explorer window appears, do the following:

  1. Click on the Tools menu and select Map Network Drive….
  2. In the next window, select the drive letter that you wish to refer to your Ubuntu shared drive
  3. In the folder field, enter the name of the machine and the shared directory in this format \\your-machine-name\shared-directory-name
  4. Specify whether or not you want Windows to automatically connect to the Ubuntu machine at logon.
  5. Click Finish

Permitting everything has been setup correctly, you should a new drive should appear in Windows Explorer that maps to the shared directory in Ubuntu.

Setup SyncToy To Backup to Ubuntu

Configuring SyncToy is easy - now that there is a drive mapping from Windows to Ubuntu, it can be treated like any other Windows directory.

  1. Open SyncToy and click on Create New Folder Pair.
  2. For the left folder, select the directory on your Windows machine that contains the files you wish to backup.
  3. For the left folder, select the recently mapped drive.
  4. Select the synchronization configuration option as mentioned in Part 1.
  5. Name the folder pair.

If you wish to schedule asynchronous backups, then setup a second scheduled task using the process that was outlined in Part 1; otherwise, you’re all done.

Automated Backups with Windows and Ubuntu, Part 1

To me, one of the most important things is keeping consistent backups of all of my data. Years ago, it was easy enough to keep data backed up on a couple of floppy disks. After that, data began spanning a couple of Iomega Zip disks. Once CD burners became popular, I ended up burning my files to a couple of CD’s each month. In the past few years, it’s become necessary to keep information stored on a separate hard drive just in case another one fails.

For a few months, I was using DriveImage XML to keep weekly snapshots of my important data. It worked fine; however, I began to notice that the level of file fragmentation on my hard drive following a snapshot was ridiculously high. Over the past couple of weeks, I’ve been investigating a couple of different reliable backup solutions. The most important thing to me is to be able to keep frequent - as in weekly - snapshots of my data, have it stored in a location that is easily accessible, and have a low risk of having the storage medium fail.

At first, I heavily considered using Amazon S3 . It would allow me to store my data in the cloud in a very secure, very reliable medium. I’m still considering using it at some point, but I’ve opted for a slightly simpler solution. Although it’s not quite as attractive as S3, it’s cheaper and, for now, that was the ultimate selling point. Before going into the details of how I automate my backups, it’s worth noting my setup.

My System Setup

I’ve got two computers - one running Windows XP and another running Ubuntu Linux. The XP machine contains two hard drives. One drive contains the operating system and all of the program files, and the other drive contains all of the data that I deem worth backing up. My Linux box acts as a local web server and local file server. It currently serves as a place on which to test various web development projects, and also a place to host other various files.

The primary reason that my files reside on my Windows machine is because I use that box for most of my projects. Considering the majority of the stuff that I do is oriented in web development, and, as much as I love Linux, the majority of people that use the web are still using Internet Explorer, Windows is a larger target for web development. This can be debated, but that’s another post so I digress. Anyway, to that end, I need to have fast access to some of my files while working on things.

How I Backup My Data

Introducing SyncToy

Since Windows 95, Microsoft has released free, small utilities for its operating system known as PowerToys . While investigating alternative backup solutions, I came across one called SyncToy . It’s an extremely easy-to-use, utterly simplistic PowerToy. At first, I was really skeptical as to if something this simple would serve as a solid backup solution. Because it would take next to no time to download and install it, I gave it a try. Surprisingly enough, I’ve been really pleased. In fact, I’ve ended up using SyncToy to automate my backups for the past couple of weeks.

The thing about SyncToy is that it serves one purpose and fully recognizes what it is. It doesn’t try to do more than it should, or attempt to present itself as the end-all-be-all of backup software. I like it because it knows its place, so to speak. With that said, SyncToy offers several options for backing up your data. These options include…

  • Synchronization. This option will take the newest files from either drive and copy them to the drive that has an older or non-existent version. It will also make sure that each drive as the most updated filenames, and no drive has files that the other does not. This option is useful if you frequently save data to more than one drive.
  • Echo. This option will take all files from a source drive and copy them to the destination drive. If a file has been renamed or deleted on the source drive, this change will be reflected on the destination drive.
  • Subscribe. This option will take files that have been updated on the “right drive” (typically the destination drive) and copy them over to the “left drive” (typically the source drive).
  • Contribute. Contribute is similar to subscribe; however, the drive from which operations are performed is reversed. Files that are new and/or updated on the “left drive” (again, typically the source drive) are copied to the “right drive” (which is usually the destination drive). No files are deleted in Contribute mode.
  • Combine. This operation will combine new and updated files from either drive much like synchronization mode; however, no renamed files or deleted files will be handles.

For my purposes, Echo works the best. I keep all of my data on an internal drive and want that data replicated to two locations - more on this in a bit.

Automating Backups with SyncToy

Of course, backups should be automated - no one wants to initiate a backup of their data while they are at their computer because it’s inconvenient. Operations like this not only take time, but it’s usually lame to be working on a system while it’s busy performing a bunch of file operations. Luckily, SyncToy can be run via the command-line and, thus, can be setup as a scheduled task in Windows to run automatically.

For those of you that are interested, setting up SyncToy to perform automatic backups it easy. Assuming that you’ve already setup your folder pairs (or your source drive and destination drive within SyncToy). here’s how to schedule an automatic backup…

  1. Launch the Scheduled Tasks applet from the Start | Programs | Accessories | System Tools menu and double-click on the Add Scheduled Task icon. This will launch the Scheduled Task Wizard.
  2. When you’re asked to select the application for Windows to run, click Browse.. and find the SyncToy executable on your hard drive. Mine is located in C:\Program Files\SyncToy\SyncToy.exe .
  3. On the next screen, select how often you want the task to run. I have mine set to Weekly .
  4. Next, you’ll be asked to pick details about the task. Select a time, how many weeks, and the day(s) during which you want your backups to occur.
  5. Enter in your Windows username and password to complete the scheduled task.
  6. On the final screen, check the option that reads Open advanced properties for this task when I click Finish and then click Finish .
  7. In the Run field of the advanced properties, you’ll need to make a modification. Make sure that it contains this (including the quotation marks): “C:\Program Files\SyncToy\SyncToy.exe” -R . The -R parameter instructs SyncToy to backup all folder pairs as you’ve configured them.
  8. Click OK and confirm your Windows username and password.
  9. Click Apply and then OK . You’re done.

Based on the scheduled settings that you’ve specified and assuming that you leave your machine running all of the time, SyncToy will now regularly backup your data based on the folder pairs that you’ve configured within the application.

Backing up in multiple locations?

As previously mentioned, I actually have SyncToy backing up to two locations - since I’m not going to have the security of data redundancy that a larger service can provide, I decided it best to perform a scheduled backup to two separate locations rather than just a single drive. Call me paranoid of losing my data.

One of the automated backups goes to an external hard drive that I have connected to my machine. This allows me to keep one copy of my files that I can take with me if I ever need to do so. The other backup is sent to my Linux file server via a network drive. This network drive matched with SyncToy’s automated backups provides a really easy way to keep your files on a secondary Linux machine while simultaneously having access to some of those files should you ever need them on your local Linux installation.

In a follow-up post, I’ll explain how to map a network drive from a location on your Linux file server to your Windows machine and schedule your backups to that location. Of course, I’m always on the look out for other ways to reliably, securely, and inexpensively backup my data. If you’ve got one or have any suggestions for using SyncToy, feel free to recommend them.

Open-Source Usability

With the next version of Ubuntu Linux coming out in about a month, many of the Ubuntu blogs have been buzzing with a range of topics - discussions on new features, examples of the improvements, reports on bugs that have been addressed (and new ones that have popped up) - most of which are relatively normal. One recent post, however, caught my attention - The #1 Problem in OSS Usability and What I’m Going To Do About It. I’ve been tossing around the things that she’s discussed in that entry, and figured I’d post my thoughts here.

The author makes some really good points in her article and so I’m going to try to avoid repeating too much of what she has already said. Before getting into it, though, I’d like to concisely summarize my opinions on development and usability without going off on a tangent:

1. Programmers should not be the sole people responsible for building the interface. They should be responsible for designing the software and building the interface around specifications determine by designers - not throwing in an interface element for every single function in the software.

2. Designers should not pretend that they are programmers, but should have a solid understanding of what the software is supposed to be doing. Don’t decorate the interface with unnecessary elements - minimalist, intuitive design is key.

Unfortunately, one of the down sides of open-source software is that a large majority of the interfaces for software that is developed is done so by programmers. That’s why it’s not surprising to see something like this, versus seeing something like this
on any given Linux distribution.

So why is her idea awesome?

First off, she not only understands usability, but she understands what the problem is with regard to usability in the open-source community. Usability is something that is already greatly ignored in software development, but even more so in a community that is primarily made up of geeks and software developers. We care more about something working versus how it looks, and it shows whenever you look at almost any piece of software that’s been hacked together.

Secondly, she’s got direction on how to address the issue. Because lack of research is the largest factor contributing to low-levels of usability, and because there’s no set standard or method of documenting the research, there’s no way to move forward with improving usability if there’s no reference on what to improve. Developing formalized documentation from the open-source community is an awesome place to start.

Lastly, she knows where to begin. She doesn’t really have a half-baked idea - she’s not only addressed the problem or how to solve it, but she’s addressed how to get it started, has explained how’s she’s going to do it, and has the personal investment in the project to keep it going. She’s got direction and you can’t drive anywhere without good directions.

Why I think this will work

Having “Open-Source Usability” is something that I’ve never really thought about, despite the fact that it makes sense. I’ve typically associated the open-source community with geeks - people that care more about good looking code rather than graphical user interfaces, people that care more about decreasing the number of cycles their algorithm costs just for the sake of decreasing it, and, generally speaking, people that care more about increasing functionality rather than experience.

When I first read this article, I was kind of quick to write it off - not because I thought it was a bad idea, but just because I didn’t think it was feasible. I’ve read the article several times and have been thinking about it for a few days. The more I thought about it, the more interested I became in this whole initiative. I then began to think about the open-source community and if it would be, well, open for something like this. I kept thinking about all of the ways in which people who care about design, usability, etc. would be deterred from Linux - then I realized it has nothing to do with the operating system. It has to do with what you’re passionate about doing, and being able to see the manifestation of your work - Linux is definitely provides a platform for doing this. I then began to think about other platforms that was open to a wide array of different users each with a range of different interests where they all cooperate - Wikipedia. I’m sold.

Open-Source Usability is step in the right direction for not only continuing to bring Linux into the mainstream (because I hold the opinion that it still isn’t ready despite so many awesome advances in the past three years), but for improving on the open-source model that has worked so well over the past several years (over a decade, even!). I’m pretty excited to see where this will go.

Joel on Software on Web Standards

Joel on Software is a site that anyone and everyone oriented in application or web development should read. Nearly every post he makes has value to it, but his most recent post on web standards is excellent. It does an amazing job of saying absolutely everything that should be said and nothing that shouldn’t be said and it does so in best way possible.

Zuckerberg said the episode taught him an important lesson. "Almost all…

Zuckerberg said the episode taught him an important lesson. “Almost all of the mistakes we made, we didn’t give people enough control,” he said. “We need to give people complete control over their information. The more control and the more granular the control, the more info people will share and the more we will be able to achieve our goals.”

One of the main problems I have with Facebook is exactly this. I’m glad that Zuckerberg acknowledges his mistake, but how many times can you keep making the same mistake before you learn from it? Furthermore, I think he, and others, should realize that not everyone wants to share everything.
Read more from the article here.