Sunday, June 15, 2008

Invalid File Names Can Slow Backing Up in Ubuntu

I went out and bought myself one of those 250 GB Western Digital Passport USB-powered portable hard drives to back up our computers. My wife has a Vista Laptop. I have an XP laptop from work. I also have a desktop running Ubuntu Linux exclusively.

I hate using backup software. I think it is stupid and a waste of time. I don't like installing software just to recover my documents. I've also had backup files be corrupt in one spot and have lost the entire backup because of it. I'd rather just lose a file here and there. I prefer to simply copy the files from my home directory to the backup drive. That seems to make the most sense.

These new portable USB powered drives are inexpensive, extremely fast, and have huge amounts of room on them. I was happy to give mine a try.

However, I discovered a major snafu while copying my mp3 files from Ubuntu Linux to a fat-formatted backup drive. The Linux ext3 filesystem allows special characters in filenames. The FAT filesystem on most USB powered drives does not. I had tons of mp3s (7 GB) with commas, parentheses, and colons in their names.

Was I going to rename them one at a time? Hell no!

I found this command in a forum, and it worked beautifully to remove every special character from all of my mp3's:

find /home/me/Music/ -iname "*" -exec rename -v 's/\:|\*|\?|\"//g' "{}" \;

In one stroke, all of my special characters were deleted and my mp3's could copy over without issue. This is another reason I don't like backup programs or automating the backup process. I like to monitor what is going on.

I backed up all of my email, pictures, music, documents, web site source, and everything else in about 20 minutes - in total it was about 44 GB of data. The drive could back up 4 more sets of computers this way and not run out of room.

I love the drive, and I love that command.

Make sure you backup weekly. You will hate yourself if you do not.

No comments: