Aquarionics

Home | Projects | Archives | About Aquarionics | About Aquarion

Backups

You should back up your data.

You should periodically review this backup system to make sure you can get data back off it, but you should back up your data.

I’ve been doing this “computer guy” thing for a while now, and these are three things I have learnt are always true:

  1. The only way to be absolutely sure you get rid of a virus is to nuke the system it’s sitting on.
  2. Backup solutions that require the user to perform an action don’t work.
  3. The universe tends to irony WRT backup systems. And everything else.

The second is always true, from the lowliest “I want the blue “e” to work again” casual user though the most fan-speed obsessed poweruser to the most jaded and cynical sysadmin, if your backup system requires you to actually do something, then it’ll happen less often than it needs to and the time you fail to do it, or fail to check it, will be the day your harddrive dies.

Apple’s Time Machine is great, because it automatically syncs stuff to an external hard drive or network backup as you’re using the machine. If you have a laptop with it, set it up with a network backup, because while it warns you about your last backup being out of date it will go away if you tell it to, and that’s a recipe for badness.

Obviously this is where I explain how my backup system is the ultimate, most perfect way to solve this problem, but it isn’t. This the way that works for me:

Dropbox

My music, documents and projects get synced to Dropbox on a continuous basis as I’m using them (it used to be just Documents, but I started using them as a full backup system last year) and from there synced back down to my other machines (Directly over the lan with the latest version). By sharing subfolders with other accounts, Documents & Projects get synced down to my laptop when it gets plugged into wifi (it doesn’t have the disk space for the whole thing) and as soon as Dropbox sort sub-folder syncing even that complication will go away. Various subfolders are shared with other actual people too, for the things I work on with other people.

It’s good, it works, I know within a few hours if it’s broken, and I don’t have to think about it.

Which is, for me, the perfect backup system.
Windows 7 has a great backup system also. It will continually pester you until you set up some kind of backup system, and then it will pester you if that stops working.

Neither of them are good enough, though. You can ignore the messages, you can forget to plug in the external drive every so often.

(Downsides mainly involve trusting a third party with your data)

If Ubuntu’s magic personal backup system was cross platform, I’d probably use that (this syncs between three OSs), but trading into a different closed ghetto isn’t something I consider a good idea.

January 24, 2010 - 1:30 PM Comment (1)

To remove a host that denyhosts has banned

Denyhosts is a utility that automatically bans IPs who attempt to ssh in to your server and get three wrong passwords. This is great when people are dictionary-attacking your SSH server, but less good when you have actual users who might get their password wrong.

The FAQ for denyhosts says how to fix this if it happens and your users are banned, but it’s a bit faffy, so I’m putting my script here. It works for me, it may screw your life up. Backups are your friend.

#/bin/sh
REMOVE=$1

/etc/init.d/denyhosts stop

cd /var/lib/denyhosts
for THISFILE in hosts hosts-restricted hosts-root hosts-valid users-hosts;
do
mv $THISFILE /tmp/;
cat /tmp/$THISFILE | grep -v $REMOVE > $THISFILE;
rm /tmp/$THISFILE;
done;

mv /etc/hosts.deny /tmp/
cat /tmp/hosts.deny | grep -v $REMOVE > /etc/hosts.deny;
rm /tmp/hosts.deny

/etc/init.d/denyhosts start

Needs to run as root or someone with access to all denyhost’s files (plus hosts.deny).

Tags: , ,
May 13, 2009 - 8:29 PM Comments (3)