In a galaxy far far away…

…my own little world

Archive for the 'Computers & IT' Category


My super-backup adventure!

Posted by bwakefield on 8th November 2007

So, a few months ago I embarked on an adventure that involved backing up our production webserver to tape. Yes, tape. A really big, hunk of magnetized plastic. It was a long trip, took way more time than one would think is necessary. First, the Powervault unit was not even powered on, go figure. Then a second trip down to the server room reveled that the SCSI cable was not plugged into the correct channel! So after all that was resolved, the trick was getting the data backed up properly. Here is how our data (that needs backed up) is laid out:

/home/clients - all of our clients web files are stored her.
/var/www/[hosted domain] - we have several hosted domains, both from a couple clients and some sites we run ourselves.

We are also making use of AutoMySQLbackup and the files that it creates need to be stored long term on the tape as well. So here is what I did…

#####################################################################################
# Server Backup - VAR and HOME
# Create individual tar/gz files
#####################################################################################
mkdir /backup/`date +‘%F-%a’`
tar -cvvzf /backup/`date +‘%F-%a’`/hosteddomain1-www-`date +‘%F-%a’`-tar.gz /var/www/hosted1
tar -cvvzf /backup/`date +‘%F-%a’`/hosteddomain2-www-`date +‘%F-%a’`-tar.gz /var/www/hosted2
tar -cvvzf /backup/`date +‘%F-%a’`/clients-`date +‘%F-%a’`-tar.gz /home/clients

#####################################################################################
# Write some information to the log file
#####################################################################################
echo “————————————————————-” >> /home/backup/backup.log
echo “Full Backup for:” >> /home/backup/backup.log
date >> /home/backup/backup.log
echo “————————————————————-” >> /home/backup/backup.log
du -sh /backup/`date +‘%F-%a’`/* >> /home/backup/backup.log
du -sh /backup/sql/latest/ >> /home/backup/backup.log
echo “————————————————————-” >> /home/backup/backup.log

#####################################################################################
# Delete the tar/gz files once they are written to tape
#####################################################################################
#delete the previous backup which is stored on disk for easy access, create the new ‘lastest’ for the files and SQL
rm /backup/latest
mv /backup/`date +‘%F-%a’`/* /backup/latest
cp -R /backup/sql/latest /backup/latest/sql

#####################################################################################
# add total backup size to log file
#####################################################################################
echo “Total backup size:” >> /home/backup/backup.log
du -sh /backup/latest >> /home/backup/backup.log
echo “————————————————————-” >> /home/backup/backup.log
echo “” >> /home/backup/backup.log

#####################################################################################
# Copy backed up tar/gz files to the tape drive with the latest SQL backup
#####################################################################################
tar cfv /dev/tape /backup/latest

This code keeps the latest backup on the disk for easy access as well as puts it to the tape. I try to keep a basic log file to have an idea what has been written and how large it was. I haven’t found a good way to keep a running count of how much has been written to the tape yet. Once I do, the log file will be simplified quite a bit. This script is run M/W/F and a similar script that backups only the SQL files Sa/Su/T/R.

There were a few sites that were of great help getting the tape backup working well:
http://www.whoopis.com/howtos/tapebackup.html
http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/

There was another site, which I don’t have handy at the moment, but I will update as soon as I find the link.

Posted in Computers & IT, Linux | No Comments »

Stage 1 - Define your needs

Posted by bwakefield on 28th August 2007

“Measure twice, cut once.” When it comes to any major (or minor!) project, planning is everything. Many headaches will be avoided if you start planning your network infrastructure by clearly defining the requirements and needs for the network.

What do you need out of your network infrastructure? What goals or mission is going to be accomplished by your network? What does your “business” revolve around? Do you leverage technology to meet your goals or are you a provider of tools using that technology? The first thing that comes to mind for me, is email. There are many options, and this choice could determine what route you go for the rest of the network. What do you need from your email? Email is closely followed by a “domain” solution, file server, and web hosting (no particular order to the last items).

Read the rest of this entry »

Posted in Computers & IT | No Comments »

Save a copy of your Putty Session Settings

Posted by bwakefield on 6th August 2007

I have found a few nifty ways to copy your settings for Putty. Putty is a windows SSH client allowing a secure cli (command line interface) to *nix based servers. I use it daily for various tasks related to managing the Ideas Unleashed servers. I do have a habit of formatting my systems semi-frequently, at least once a year, so keeping track of bookmarks, Filezilla settings (a topic for a future blog), Putty settings, and many other things difficult.

However, saving and restoring your Putty Settings is a snap! From the Start -> run dialog, run this command to place a .reg file on your desktop that you can merge on another windows system to copy your putty settings.

regedit /e "%userprofile%\desktop\putty.reg" HKEY_CURRENT_USER\Software\Simontatham

Thanks to Joe Mansfield’s comment for the shortcut!

Posted in Computers & IT | 1 Comment »

Bring the power of Apt-Get to Windows!

Posted by bwakefield on 1st August 2007

win-get is a windows “clone” of the apt-get utitlity used in debian based Linux distributions. It will allow you to install free software for windows, on windows, in the same style as Linux.

apt-get install softwaretitle

Posted in Computers & IT | No Comments »

Enargi Code Snippet Plugin

Posted by bwakefield on 30th July 2007

I am going to be making more use of this plugin and I have found it to be extremely helpful in the past. The original location for this plugin is down and has been for some time. The plugin was released under the GPL, and I am sharing it here for others to use. It is a great way to share source code and code snippets for various languages within a wordpress post and include the syntax and highlighting.

I was able to download the plugin here after finding the original host was gone.

Posted in Computers & IT, Wordpress | No Comments »

All I need to know to be a better programmer…

Posted by bwakefield on 25th July 2007

… I learned in kindergarten!

1. Share everything.

Use open source where possible, and contribute to it when you are able. The collective wisdom of the entire community is better than the limited vision of a few large companies.

2. Play fair.

Give other technologies, frameworks, methodologies and opinions a chance. Don’t think your choices are the only ones that work. The other choices may very well be better than yours; it doesn’t hurt to check them out with an open mind.

3. Don’t hit people.

Like #2, don’t attack people just because they happen to use .Net or Java or PHP (I learned my lesson there!). Sometimes they might be more usable and useful than you think. You can learn a lot more from someone when you are not pounding them to a pulp. Read the rest of this entry »

Posted in Computers & IT | No Comments »