Geek / Technical General

Wikis and Collective Knowledge

Wikis are great resources for collective knowledge. Wikis are counter to the culture in which copyright and patent laws encourage scarcity and “mine vs yours” debates. When everyone in the world is involved in a project, you would think it would break down, but they don’t. You would think that defacement would be a huge problem, but it isn’t. Most defacements are caught within minutes on Wikipedia, for instance. Anyone can make changes, but anyone can revert changes as well.

Wikis are great because anyone can make changes. Something missing? Add it! Spot an error? Fix it yourself! It’s open source hacking, but you don’t have to know how to program to participate. You just have to know how to write. It’s been used to document things publicly, such as software projects, but it is also used privately. Supposedly The New York Times used an internal Wiki for its staff.

I’ve contributed to a few Wikis, and I know more changes have been made since then by others. Post a comment and let me know what your favorite Wikis are!

General wikis:
Wikipedia: the free, online encyclopedia
Wike-Wiki: documentation on using Wine
Wiki Science: a Wiki about Wikis?
A Wiki in the Desert: about the game A Tale in the Desert

Game Dev:
Game Programming Wiki
Indie Wiki
Game Programmer’s Wiki
UnrealWiki: about the Unreal Engine

GCC Wiki: about the Gnu Compiler Collection

KDE Wiki: about the popular, open source desktop
Gentoo Linux Wiki: all about the popular Gnu/Linux distro Wiki: learn all about Linux

Game Development Geek / Technical Politics/Government

Software Patents? No Thanks!

I just read an article on Gamasutra titled It’s Just a Game, Right? Top Mythconceptions on Patent Protection of Video Games. I am interested in news and articles on software patents, and I’ve always been against them. While I believe patents can cover a physical invention, like a better mousetrap or printing press, I don’t believe patents should cover things like mathematics or intangible ideas.

You want to protect your software? Copyright covers your needs. It’s cheaper, and it’s faster. Trademark will protect anything from logos to specific characters. But patents? Way too expensive. They also bring the software industry to a standstill rather than push its progress along as claimed. Patents are supposed to be granted for non-obvious inventions. Most software patents are for obvious ideas. Anatomy of a Trivial Patent shows how easy it is to make something obvious sound incredibly complex and inventive.

When I read this article, I was hoping to receive information that either supports my view or gives convincing arguments for the opposing view. What I read, however, was lame B.S. about the “merits” of software patents. I will now go through each of these myths getting “busted” throughout the article.

Myth 1:
The first Myth being “busted” here is that you can’t patent computer programs. The truth is, you can patent specific ideas that are used in video games, but the author decides to argue this myth by first pointing out that you can patent the computer/console hardware. Huh? He then gets to the software portion:

  1. “Scoring based on goals achieved and subjective elements” sounds awfully familiar. Oh yeah, it is because most games with scores give you points for doing certain tasks, and the idea that you can get points for doing things in a cool way isn’t all that innovative, is it?
  2. A patent on the use of a machine? Again, not the same argument here.
  3. Sega’s patent on making characters run out of the way of an oncoming vehicle. Something that happens in CARTOONS and real life all the time!
  4. Battlefield strength and morale in a strategy game. Aren’t board games using this mechanic? Couldn’t I just as easily call these elements something else, like “popularity” or “happiness points”?

He also talks about how you can patent the distinct way a logo appears on the screen. These are actually the also-controversial “design patents”. I think trademark would do just fine here. In fact, that’s what trademarks are perfectly suited for because that’s what they were made to protect! Let’s look at the entry in the US Patent database: D487,574 has a list of other design patents that say essentially the same exact thing:
“The ornamental design for an icon for a display screen, as shown and described.”
“The ornamental design for an interface for a display screen for an electronic device, as shown and described.”
“Surface ornamentation for a handheld computer or a computer-generated icon for a handheld computer.”
“Icon for a display screen.”

Aren’t patents supposed to be granted for inventions? What’s so inventive about each of these that the others don’t already have prior art on?

And in any case, at no point is the “myth” that you can’t patent computer programs actually busted. You can patent techniques and algorithms, not whole programs. Nice try, author.

Myth 2:
The argument being made here is that even if you make a clone of a game, you have to have something unique about it, right? Patent that unique thing!

I create a power-up that makes the entire screen turn upside-down. Is that really going to be considered patentable?

Myth 3:
This argument says that while a patent might take a long time, you can get provisional rights, giving your application power even if your patent isn’t approved yet. Also, there is this quote:

Additionally, this may be another example of selling yourself short. Many inventions are broader in scope than the particular embodiment first produced by the inventor, and a good patent attorney can help an inventor identify the true, full scope of the idea that has been invented.

No, a good patent attorney can help an inventor identify the wording to make an otherwise specific “invention” cover a broad range of other “inventions”. You can patent “a mechanism for keeping point totals in order” and now you control the Top 10 List, but if you patent “a mechanism for displaying data in an arbitrary order” you have now patented not only the Top 10 List, but also end-game statistics for all kinds of games. Essentially, the author here is trying to convince you that there is a lot of money to be made by making your “invention” as broad as possible to cover as many possibilities as possible.

Myth 4:
Suing is expensive. The author ignores that point by arguing that patents are used for more than simply suing. Fine. But this line:

A patent portfolio is also a good defensive tool. Competitors, who will no doubt take advantage of the patent process for themselves, will think twice about suing you if there’s a threat of you suing them back (i.e., a countersuit).

Yeah, I’m sorry. No. If IBM, Microsoft, or probably even EA decides to sue you, your single, measly patent isn’t going to do anything. These companies will likely claim that your patent is actually making use of one of their patents. Imagine coming into a water-balloon fight with a pack of balloons, and the opponent holds the only water hose to fill them. That’s what it is like. IBM has argued that its huge patent portfolio is a great set of assets not because they receive licensing revenue, but because IBM can write whatever software it wants. NO ONE can go to IBM and say, “Hey, you’ve infringed on my patent, so give me money!” because IBM will return with, “YOUR patent makes use of any number of the thousands of patents we have. You can go away now. Oh, and you’ll also let us license your patent at no real cost to us. Have a nice day.”

Myth 5:

The “spirit of innovation” works best when there is a free market of ideas, and consumers are better off if video games are not patented.A classic argument among those who feel that the entire patent system should be abolished. You might want to make that argument to your representative in Congress, because unless the Constitution is amended to do away with patents, they’re here to stay.

The quote above is one of the examples that really showed that this article wasn’t meant to be informative so much as to persuade through deceit. One, people aren’t arguing to abolish the entire patent system. People are arguing that certain types of patents, specifically software patents, shouldn’t exist. The second statement implies that the Constitution already mentions patents, when it doesn’t. The Constitution grants the power to create ways to reward people for progress, but doesn’t create any specific power, like copyright or patents.

The patent system changes. So does copyright. It isn’t a far stretch to think that some changes are better than others, and some changes are just plain bad. The ability to patent software is one such change.

In the last paragraph for this “myth buster”, he talks about Ralph Baer, who supposedly gets credit as the father of video games. Don’t most people believe that Nolan Bushnell did it first? In fact, the author mentions Pong, which is technically Bushnell’s game. Bushnell opted out of a patent infringement suit by Magnavox because Pong was based on Baer’s more complex Ping-Pong game. Other companies lost lawsuits, and Magnavox made a lot of money. The author then mentions that Spacewar was created by Steve Russell.

Unfortunately for him, Russell did not seek patent protection on his concept, and did not document his development efforts as well as Baer. We will never know how history may have been rewritten had Russell sought patent protection on Spacewar. The moral of the story is simple: you should act to protect your inventions.

It sure sounds like it. Baer makes millions, and Russell failed. No, wait. Let’s remember who Russell was. A programmer at MIT. He made the first game that would be distributed with the computers being used at the time, which were mainframes. Trading programs wasn’t called piracy back then. It was called sharing. And you did so with tape, not disks. No one downloaded anything over p2p networks.

Russell was a student, and he hacked just for fun on the new DEC PDP-1. No one at the time thought to make money by selling software, let alone games. So Russell wasn’t trying to make money off of his game. Once again, the author is trying to convince you that software patents are great by offering up hints of ideas that you will hopefully turn into facts in your mind. I know the story, and so I knew that this comparison was horribly contrived and the language implied something that isn’t true. How many people know about Steve Russell and Spacewar? How many people reading this article would think that Russell “failed” with his game while Baer succeeded with “his” Pong?

If that specific paragraph in the author’s article doesn’t convince you that this author is trying to sell you something, I don’t know what will.

Myth 6:
Patents are expensive. The research prior to filing may be cheaper than ever, but the filing of a patent costs serious money. Maybe EA can afford to pay the thousands just to patent games, but indie developer budgets can easily double or triple due to filing costs. Don’t forget that if you have to sue or defend yourself, your lawyers will cost money too. Not everyone will make millions by suing people who make card games.

In the end:

Video game innovations will play a large role in determining who shares in the ever-growing multi-billion-dollar video game industry. As more and more companies enter the market, and spend more and more resources developing those innovations, protecting those innovations will become even more critical.

Whoa, whoa, whoa! Back up a bit here. If the Constitution grants the power to create things like copyright and patent laws to promote innovation, and more companies are entering the market and creating things, do we need MORE protection? Doesn’t this just contradict everything the author himself was saying? Patents allow for progress. There is more progress. Therefore, we need to “protect” progress? From who or what are we protecting our “inventions”? The author doesn’t say. The implication, of course, is that other people will take your “invention” and start making money from it, and you need to protect yourself.

We don’t need software patents to make software. Software patents don’t promote progress. They stifle it. Most software patents are being used defensively. Microsoft, IBM, and others trade licenses, and no real lawsuit gets completed anymore. “You can make use of our XOR patent if we get the right to use your patent on computer animation with color.” Not everyone is Microsoft or IBM, and so not everyone would benefit from software patents. The only real reason given in the article is to do it because everyone else is doing it. Get them before they get you.

Software innovation happens in spite of software patents, not because of it. If everyone who wrote software had to do a lengthy patent search before writing code or releasing projects, how many projects would be dead due to IBM alone? As the author explains, ANYTHING can be patented, so it isn’t like software patents are documenting actual inventions.

Software patents don’t protect anyone but large companies. They are expensive. They cover ideas, algorithms, and mathematics when patents are supposed to cover actual inventions. And even more important, the author was clearly trying to deceive rather than provide actual information. Can someone give REAL arguments for software patents? It doesn’t seem so. Most arguments “for software patents” tend to sidestep the issue and claim that patents are doing what they always do. Such arguments ignore the fact that software development is not like building vehicles, and they ignore the actual question: should software patents exist?

I believe they shouldn’t.

Some links:
League for Programming Freedom
Paper arguing that software patents would actually reduce innovation and progress (PDF format)

Geek / Technical General

Support for Gnu/Linux Systems

People who use Windows have a couple of huge advantages over people who use Gnu/Linux: games and hardware/service support.

Defeating the no-help desk is an article on Newsforge that talks about how to get around tech support that isn’t helpful if you run something other than what is explicitly supported.

What you should never reveal

Many call centers bill by the call, so they are focused on the number of calls they complete, not the number of problems solved or the degree to which customers are satisfied. In these situations, the phone support person you’re calling has one duty: to get you off the phone as fast as possible without breaking the rules. There may not be as much concern for whether your problem is solved as you’d like. That means that the support person’s first strategy may be to find a reason why he cannot help you. If so, your response should be to eliminate every reason that he might have to end the call.

I’ve worked part-time at a help desk for a few years. In the beginning the goal was to solve problems. Near the end of my employment I was told by someone that the new goal was to get off the phone within two minutes. I wasn’t told in an official way, so I didn’t pay attention to it. What I found was that I was making a lot of people happy by actually solving their problems, especially after others might have gotten them off the phone fairly quickly.

But this post is not about poor service. This post is about support issues when running Gnu/Linux.

A lot of companies have a policy of not supporting anything but users running Windows and maybe Mac OS X. Sometimes this policy makes sense, such as ActiveX controls or DirectX issues. Fine.

How about ISPs? They provide a network connection, and NOTHING about the operating system you use should matter. Yet if you don’t run exactly what they require, you’re out of luck. In my area, I had a choice between cable and two DSL providers. I asked questions. The general idea:

Cable company: “We offer one package. You can use one computer. It must run Windows.”
Local phone company’s DSL: “We offer PPPoE, so it isn’t always on, you must login to use it each time, and we require you to run Windows.”
Speakeasy DSL: “We give you a network connection. So long as it isn’t illegal, you can do whatever you want with it.”

Speakeasy was way more expensive than either of the other options. I went with Speakeasy anyway. I don’t have to pay extra for each machine on my network. I don’t have to pretend to be using a different OS. I don’t have to lie. I also get very knowledgeable tech support whenever something goes wrong. When I move into a new place, I am making damn sure I get Speakeasy again.

Similarly, if hardware fails, the fact that I am using Gnu/Linux shouldn’t matter. A bad hard drive is a bad hard drive. A fried motherboard or CPU is just that. No, I highly doubt that the fact I was running Firefox instead of IE matters. I don’t think that Gnu/Linux use prevents someone from replacing the CD drive. At this point, drivers don’t matter. The fact you don’t support the use of the device under Gnu/Linux doesn’t matter. Imagine telling someone using Windows that a failed hard drive can’t be supported because Service Pack 2 isn’t supported or the use of non-Microsoft products on the system voids the service support contract.

Well, in that case, there might be enough people that think that they have no choice in the matter and give up. They’re used to it by now. People have been conditioned to be afraid of the computer. If something goes wrong, they are conditioned to believe that it is their fault and nothing can be done. “We don’t support it” is simply translated as “Do exactly as we say or else you lose all of your photos and term papers!!”

I like computers. I am not intimidated by technology. I made sure I was knowledgeable enough to have a choice. I didn’t like the idea of Microsoft’s Activation, so I made Gnu/Linux my main operating system. These days it is easier than ever for people to do this switch, especially with distros like Knoppix, Ubuntu, and others. Unfortunately, “we don’t support it” forces people to stay with an otherwise lacking system like Windows. “My digital camera won’t on Gnu/Linux?” “I just paid $300 for this printer and there are no drivers for it?!” “I have to run Windows just to check my email?!?”

So there are a few options to get support:

  • Keep Windows around, either on a second machine or a dual boot configuration.
  • Lie about what you’re using, requiring that you’re knowledgeable.
  • Not use the service or hardware.

Some people find one or more of the options unbearable. Hardcore Free Software people wouldn’t want to use Windows nor would they want to lie about what they use. Others would be hard pressed to do without the service or hardware. Either way, everyone loses.

Geek / Technical

MAKE: 10 Things to Do With Old PCs

People have been fairly excited about the new Make magazine. From the page:

The first magazine devoted to digital projects, hardware hacks, and D.I.Y. inspiration.

They actually have a blog where they post interesting projects. Today I found an entry on 10 Things to Do With Old PCs. I was amused that out of all of the cool things they mentioned, “Install Linux” was simply one option and not a preprequisite for most of them. B-)

I’ve been using a home network for some time and it was a great learning experience. As a gamer, LAN parties are a semi-normal part of life, and setting up LANs is second-nature now. My main system is my multimedia center, and I am interested in making a DVR. I run my own webserver and file server. I even make automated backups across the network.

Sure, none of it “requires” you to use Gnu/Linux. Windows is currently much preferred for LAN parties due to the number of games it has. Still, what’s the point of tinkering with an old box if you aren’t trying to learn something? And isn’t it easier to learn how an engine works when it is visible? When you can take it apart and put it back together again? One of the big things that appealed to me about Gnu/Linux was that it was hackable, meaning that I could mess with it all I wanted without worrying about some violation of a draconian EULA.

Make obviously needs to cater to as many customers as it can, and most people run Windows in some form. Still, I can’t help wondering how much easier it would be to setup a central repository for files or create a personal website for your LAN when running Gnu/Linux. It would also be cheaper since you would technically have to buy a license for Windows in order to run it on the new member of your computer family. You’ll be hard pressed to find an older version of Windows that would run on an older machine, so be prepared for potentially expensive hardware upgrades just to meet minimum specs. Some Linux-based distros, on the other hand, can run on machines that gave Windows 98 problems, and most distros will run on the low-specs described in the article. Since you don’t need a per-machine license, you can even create your own Beowulf cluster if you have multiple old machines.

Game Development Games Geek / Technical

Out of Touch with Games

I’ve been meaning to post about how I am out of the loop when it comes to mainstream games these days. Wario Ware? I still haven’t seen it, but apparently it is huge. I didn’t see the Nintendo DS in action until a few weeks ago. In fact, I haven’t seen the PSP. Lumines? Wipeout? I haven’t seen the Game Boy Advance SP except in other people’s hands.

I wanted to check out Prince of Persia: Sands of Time a few months ago, but it was sold out. I ended up getting Metroid Prime, which is definitely a fun game, but my keyboard/mouse hands can’t remember how I used to play Goldeneye 64 with a passion. I bought Civilization III months ago because it was at impulse-buy range (under $15). I still haven’t pulled the cellophane off of it. I’m only now considering purchasing Unreal Tournament 2004, which got to the top of me and my friends’ want lists because it was available for Linux out of the box (thank you, Epic! I’ll thank you with my dollars soon).

In the meantime, there has been new a Metroid game, a new SimCity(how did THAT escape my attention?!) and an expansion pack for Doom 3. Nintendogs was out. Nintendo was announcing a new game console. All of these things were news to me way after they should have been.

I used to be on top of Nintendo-related news since I had a subscription to Nintendo Power. Last year I realized that I wasn’t playing Nintendo games as much so I gave it up, but now I find myself surprised that other people know about things before I do. I used to be the GOTO guy for Nintendo trivia and knowledge!

And regarding PC games: I just don’t have the time to play all the games I currently have, let alone buy new ones. I loved Homeworld Cataclysm, but I wasn’t going to buy Homeworld 2 since the demo didn’t impress me that much. Dungeon Siege? Sounded cool, but I wasn’t really compelled to play it. Black & White’s expansion didn’t end up in my collection even though I loved the original.

Am I really capable of making good games if I don’t even play many of the existing games? You can’t become a good writer without reading a lot of books, and I think you can’t make good games without playing a lot of games. The good games will inspire, and the bad ones will acts as sign posts, warning the intrepid developer about what not to do and where not to go.

Clearly, I have some improving to do.

Geek / Technical

Stupid Hypotheticals While in Line for Star Wars

While I was waiting in line for the new Star Wars movie last night, I posed this joke of a question: who would win in a fight, Voldemort or Vader?

Funny, right?

Well my girlfriend and our friend started discussing it. Seriously discussing it. They concluded that Voldemort would win since he only had to say something to kill Vader. I protested that Vader would do his patented choke-from-across-the-room Force move, rendering Voldemort speechless.

How did I get sucked into arguing about this?! It was a joke! I was poking fun at the die-hard fans who would ask such questions! After a few calls, we had three people for Voldemort and two for Vader. Whatever.

So then I said, “Dumbledore or Yoda?” That one I left alone, and I don’t know if they concluded anything. But “Luke Skywalker and Harry Potter? No, they’d fight on the same side!”

Oh, and the movie was great.

Geek / Technical Linux Game Development

Wine Talk

This Thursday I am giving a talk on using Wine to run Windows applications on Linux. Wine stands for Wine Is Not an Emulator. It is an implementation of the Win32 API, which means applications run at a normal speed compared to running them in actual emulators like VMWare.

That is, if they run properly. Wine is still not at version 1.0, which means that nothing is expected to work. Still, a great many apps are available as can be seen in the Application Database.

My first test was to install Starcraft. I found a few how-tos, but they aren’t terribly consistent, and it seems that the authoritative document is years old. Fortunately it wasn’t hard to install and run. The only problem I’ve found is that isn’t usable. I get a black screen and the mouse cursor disappears so I can’t join in games. Cedega is a fork of the Wine code that was made into a closed source app. It was previously called WineX. It’s database lists Starcraft as highly rated and doesn’t mention the problem. Still, I am not ready to shell out $5/month just to have Windows games I’ve already paid for running on my Gnu/Linux system, especially when some months I don’t get to play said games, and especially when there are plenty of native apps already. Also, it seems that newer versions of Wine tend to break the feature whenever it is available. I’ll wait.

My next test was Wizardry 8. I love the Wizardry series, and I feel bad that I haven’t played 8 very much. It works perfectly according to the Wine application database, so I set out to install it. I had forgotten how long it took to install this game! This is one of those 3 CD games which take up a lot of space on my hard drive. At 50% I had already added 1GB to my home directory (well, including Starcraft and the rest of Wine, but still).

Unfortunately when I try to run it, Wizardry 8 thinks I am running a debugger and wants me to stop doing so. I ended up having to find a no-cd crack in order to play this game, which goes to show you how annoying copy protection can be for legitimate owners of games. In the end, I managed to get it to play and aside from a few sound cracks during the opening video, it ran flawlessly. I am very pleased but I wish I didn’t have to go looking for a No-CD crack to play. Still, it shows a legitimate use of what would otherwise be considered illegal under the DMCA.

And Total Annihilation’s setup program wouldn’t even run on the version of Wine that I was using (20050310).

Wine just isn’t ready yet, but then no one pretends it is. Still, I have the ability to play one game as it was meant to be played, and another one works fine in single-player mode. Total Annihilation was possible at one time, so I can look forward to it in the future, I’m sure. Not bad for an incomplete project.

I’ve updated the Wine-Wiki for Wizardry 8, Starcraft, and Total Annihilation. Someone else already added their own comments about Starcraft. Wikis rule.

Geek / Technical General

DePaul Linux Community Install Fest

May 14th, this Saturday, will be the DePaul Linux Community Install Fest. It’s open to everyone, so if you’re in the Chicagoland area, check out the information on DLC’s website. Here’s a handy map to the event.

Geek / Technical

Snapback2 How-To

Not too long ago I created my own automated backup script. Shortly afterwards, helpful people sent me links to other, more robust scripts that have been written. One of those was called Snapback2.

Snapback2 is a backup script based on rsync and hard-links. I could explain what that means, but why reinvent an already well invented wheel? Again?

My original script was alright, but it worked by making an exact copy of everything each time it ran. For my 4 GB home directory, backing it up weekly over the course of a month would result in a backup directory that is 16-20 GB in size! That’s a lot of wasted space, especially when some files don’t change at all.

Snapback2 uses hard links and only stores changes between one backup to the next, which means that if I only changed files that were 30MB in size, then the next backup will be 30MB as well. If no changes were made, then no space is wasted at all. Clearly this method is superior to what I have written.

Setting up Snapback2 is supposed to be very simple, but I found that the documentation assumes you know what you’re doing. The following is my Snapback2 How-To:

You can download Snapback2 at for the latest version as of this writing. Technically you should be able to use Perl to download it from CPAN, but I didn’t. Most of the prerequisites should be on your Linux-based system already. According to the documentation, you’ll need:

Gnu toolset, including cp, rm, and mv
rsync 2.5.7 or higher
Perl 5.8 or higher
Perl module Config::ApacheFormat

On my Debian Sarge system, I have rsync 2.6.4, so your distribution will likely have at least 2.5.7. Similarly, I have Perl 5.8.4. The one thing that you need to do is get and install Config::ApacheFormat. To do so, make sure you have root privileges and run:

# perl -MCPAN -e 'install Config::ApacheFormat'

If it is the first time you’ve used CPAN through Perl, you will be prompted to configure it. If you aren’t sure, you can simply cancel the configuration step and it apparently grabs some defaults just fine. Any and all dependencies will also be installed.

Once you have all of the prerequisites, you can install Snapback2. Again, you could probably do the same thing above to grab it from CPAN, and it will probably grab Config::ApacheFormat for you, but as I didn’t do that, I won’t cover it here.

If you grabbed the tar.gz file from the link I provided above, you should run the following:

# tar xzf Snapback2-0.5.tar.gz

It will create a directory called Snapback2-0.5. The README tells you what to do, but for completeness, here are the next steps:

# cd Snapback2-0.5
# perl Makefile.PL
# make
# make test
# make install

Snapback2 should now be installed on your system. If it isn’t, you should double-check that you have all the prerequisites. The fourth line in the previous list runs tests before installing. If something failed, you should know why from the test results. Even if you did install it successfully, it isn’t going to do anything yet. You now need to make a configuration file.

You can read the documentation setting up the configuration file in the man page for snapback2, but you can also view it online.

Here is my file, snapback.conf:

Hourlies 4
Dailies 7
Weeklies 4
Monthlies 12
AutoTime Yes

AdminEmail gberardi

LogFile /var/log/snapback.log
ChargeFile /var/log/snapback.charges

Exclude core.*

SnapbackRoot /etc/snapback

DestinationList /home/gberardi/LauraGB

Directory /home

I didn’t change it much from what was in Snapback2-0.5/examples. I installed Snapback2 on the machine called MariaGB. MariaGB will connect to, which is the IP address of my main machine called LauraGB. This is why the DestinationList refers to LauraGB. If I wanted to backup another system, say BobGB, I would keep those backups separate in their own directory called BobGB. Normally, the ssh/rsync request would ask for a password. When I setup the backups to run automatically, it won’t be useful to me if I need to be present to login. You can do the following to create a secure public/private key pair:

$ ssh-keygen -t rsa

The above line will create keys based on RSA encryption, although you could alternatively use DSA. You will be prompted for a passphrase, which is optional. Still, a good passphrase is much better than no phrase at all. Using the defaults, you should now have two files in your .ssh directory: id_rsa and The first one is your private key. DO NOT give it to anyone. The second one is your public key, which you could give to anyone. When setting up key-based authentication, you will append the contents of this file to the server’s .ssh/authorized_keys file. Next time you login, instead of being prompted for a password, you will find yourself at a prompt, ready to work. For more detailed information, read this document about using key-based authentication with SSH.

So now, if I run the following command on MariaGB:

# snapback2

It will backup any changes from LauraGB’s /home directory to MariaGB. If, however, it hasn’t been an hour since the last backup, it won’t do anything.

Still, manually running this command isn’t very useful, and while I could install a cron job to run snapback2, I will instead make sure that snapback_loop is running. It acts as a daemon, checking to see if a file gets created in /tmp/backups. Now I can create the following entry in my crontab:

# Create file for snapback_loop to run
0,30 * * * * touch /tmp/backups/snapback

So now, every 30 minutes, I create the file /tmp/backups/snapback, which snapback_loop will take as its cue to delete that file and run snapback2. Then snapback2 will make a backup if there has been enough time since the last backup was made.

Now, I have automated backups that run regularly. Some caveats:

  • Verify that snapback2 is in /usr/local/bin. On my system, snapback2 would run manually, but snapback_loop would output errors to /tmp/backups/errors that weren’t too clear. I had to create a symlink to /usr/bin/snapback2 in /usr/local/bin in order to get it to run.
  • Make sure snapback_loop is running with root privileges. It has to call snapback2, which will need access to files in /var/log and other directories which will have restricted access. If you run it as a regular user, you may get errors. You could also change the location of the log file, but /var/log is a standard spot to keep such output.
  • Because you are running it with root privileges, you’ll need to make sure root is the one with the public key in authorized keys rather than your user account. Otherwise, you’ll get errors like “permission denied” when rsync tries to connect to the other machine.

If you don’t use a second computer, you can always use a second hard drive instead. Either way, you now have an effortless system for automating your backups!

Geek / Technical

Automating Backups: I Reinvented the Wheel

I already knew that I had reinvented the wheel when it came to writing my automated backup solution. I spent some time researching this topic, and I found a number of resources.

Of course, as soon as I posted my results on the LUNI mailing list, I got email from helpful people pointing out that there are other projects that are out there and have been tested. Way better than what I had, and much more optimized. My solution was making multiple copies of my data, resulting in multiples of gigabytes of storage, whereas some of these solutions are clever and use much less space.

So in true blog fashion, here are some links: