New Years Resolution

Happy new year everybody!

Yes, even I have a new years resolution, and it’s one that all of you should have too. This particular one is one that Dann and I know all too well…

DO YOUR BACKUPS!

You see I woke this morning to the horrible realization that I could not contact my web server, had no DNS resolution, no dhcp server and no mail among other things. These are all services that are handled by my trusty old thinkpad server. And it has been dutifully doing it’s job for 7 months now without a single backup

Lucky for me, a simple reboot started things working well again, however, it also brought me to the realization that I didn’t have any backups whatsoever on my now irreplaceable server. So, it was my friend and yours, tar, to the rescue.

I just happen to have a NAS here with some space on it, so I mounted that on my workstation and wrote a little shell script, that in part, looks a lot like this:

ssh root@server “tar czvf – /etc /home /var/www /var/lib/mysql” > `date +%Y%m%d`_server.tgz

What this does is ssh as root to my server and starts the tar process that is in the Parentheses. That tar command is making a compressed copy of each one of the filesystems listed there, and those are the important ones to me in this case, and sending this info through stdout back to the machine where the ssh command started. As the tar file makes it’s way back to my workstation, where I started the ssh command from, all that info is being redirected into a file on my NAS. The date command in there simply spits out, in this case, 20080101, and the rest of the filename is appended. So what I get is a file called 20080101_server.tgz and it gets all the tgz data from my server pumped into it. Viola, instant, or at least reasonably fast, backups.

You see, this is not very hard at all. It only takes a very few minutes of your time and is well worth the aggravation if you were to lose something important. It’s also important to note that I have, for a very long time, used the “round robin” approach to my home backups. That is to say that I save different machines backups to different machines. That way, if any single machine goes down, I will still have either a good working copy, or a good backup of that machine available. Backing everything up to one single location with no duplicate copies makes me a little nervous, but then again, I haven’t done *any* backups for the last 7 months. 🙂

So anyway, here is you wakeup call today. Take 20 minutes and DO YOUR BACKUPS! You’ll thank me later.

Comments are closed.