RSS

Monthly Archives: November 2007

A backup script

Edit (nov. 17): I just realized I completely forgot to link to the file. Sorry. Here it is.


I got a external hard drive for Christmas last year to store some of the less important/larger things that I didn’t need or want on my internal 60GB hard drive. At some point I decided that it was impractical to continue backing up to DVDs and that I would have to use my external drive to to hold the backups unless I wanted to buy a tap drive (which I didn’t). So I manually copied my user file onto the drive every once in a while. I got really tired of how long that took so I started using rsync to manually backup the files. At the time I didn’t know anything about bash scripting but I though a shell script would be very useful so I didn’t have to type out the whole command (I’m lazy). I found the sites that I mentioned in the last site of the week and looked up what I needed to know to make a very simple shell script. I used that very simple script for several months until my brother started pushing me to add features and make something that other people might want to use. I’m glade he did this because as a result I learned a lot more about bash scripting and I have a much more functional and robust script. This script, after a few months of tweaking, is now at a point where I’m not embarrassed to let other people use it; It does everything that I want it to do (save 1 thing) and more importantly it is in complete working order.

So what does this script do?

  1. In place backups using rsync (as in it just keeps a folder up to date)
  2. Incremental backups
  3. backup of applications (I’m a mac user so I don’t think this would be a useful feature on Linux or BSD)
  4. restore

I bet your asking yourself “what is that feature that he wants but didn’t implement? and why didn’t he just go ahead and add it?” The feature is encryption (using gpg) and I didn’t add it because I couldn’t figure out how to get it to work in the way I want. For now if you want to encrypt it you will just have to do it by hand like a real man/woman.

If you have a large amount of data that needs to be back up it will take you a while so it is best to schedule the backup at night (if possible) or at any other time that the computer will be on but not in use. My user file is currently 22GB and I use an external USB Maxtor drive. With my setup it took me almost 9 hours for an incremental backup with a resulting file of 21.8GBs and 7 minuets for a normal+application backup. 21.8GBs is a a large file and only 1% smaller than the normal size of my user folder (assuming that it hasn’t changed in size significantly since I backed up last) so I may end up cutting out the compression in the future to save time. This talk of size brings me to another topic. My external drive is only 160GBs so I can’t fit very many backups on it which is the only reason there is an in-place backup in this script. In the future I may get a larger drive and remove the in-place backup.

I have only tested this on my computer (ibook G4) so I can’t guarantee that it will work on Linux. I am positive that it will work just fine on all Mac os X systems execpt that it uses bzip by default for incremental backups and mac os doesn’t come with bzip pre-installed, so I added an option (-g) to use gzip (which is installed by default.

There are a lot of different backup scripts and programs out there that may be far better than this one so feel free to stick with those if you want to. I don’t care how you backup your stuff as long as you do it. I’m sure you all know why it is important to back stuff up so I don’t think I need to get into that, however, I will say that just having a backup script/program is useless if you don’t use it. So Automate it!

Any bug reports/feature suggestions/patches can be left in the comments (in plain text please) or emailed to me (no I’m not going to give you my email address you have to find it yourself (I don’t need more spam.(by that I mean I don’t get spam and I don’t want to start(I’m not sure this is grammatically correct))))

Advertisements
 
Leave a comment

Posted by on November 13, 2007 in backup, bash

 

Tags: , , ,

OpenSolaris: Project Indiana

As you may know Sun announced project Indiana a while ago and they have now released the first developer preview. I tried Solaris a month or so ago and I was than impressed. I heard about Indiana before I tried Solaris so I could only hope that Indiana’s move would be one it a better direction.

I case you haven’t heard of project Indiana here is a summary from the website:

Project Indiana is working towards creating a binary distribution of an operating system built out of the OpenSolaris source code. The distribution is a point of integration for several current projects on OpenSolaris.org, including those to make the installation experience easier, to modernize the look and feel of OpenSolaris on the desktop, and to introduce a network-based package management system into Solaris.

Here is a list of the major projects that make up Indiana:

1. Image Packaging System Documentation
Choose packages from a network repository of Open Solaris packages that are ready for distribution
2. Distribution Constructor
Build an installation image from a package repository for your own distribution
3. Slim Installer/Live CD
Install Solaris quickly from the Live CD desktop
4. Snap Upgrade
Upgrade a copy of the currently running system

Before I really get into this I just have one question. Why Indiana? I live in Indiana so I my first thought was “Cool, we have our own distro of Solaris. Why?”. maybe someone really like Indiana jones (who could blame them) or maybe they like corn. (edit: I just remembered that Ian Murdoc went to Purdue university so that might be why.)

Indiana is greatly improved over the version of Solaris I tried. I could actually use this one. Last time I couldn’t get it to boot completely after installing so I don’t have much to compare this to besides that. Being able to boot a OS is very important it Sun seems to have fixed all the problem from the old version.

This is of course just a developer preview so it has lots of problem that I will mention but won’t complain about until they make it into the final release. However, it also has some really good things that I would like to praise.

Good:
1. very easy to install. you just pop in the cd and it does most of the rest for you. Easy means it doesn’t give you very many options which isn’t cool in my book but that will probably improve over time.

2. It has a package manager. I guess before it didn’t have one so it is definitely a good thing they added one. If you have ever used yum, apt-get, macports, portage, etc. then you will probably feel right at home with IPS (image packaging system). to get started using IPS by evoking it with pkg and for more info try man pgk.

Bad:
1. as is expected it isn’t stable in the least bit.
2. its slow
3. There isn’t much in the repository yet.
4. it is impossible to use dvorak or any other layout other than the default one set for your language. I’m sure it isn’t really impossible but I don’t think I should have to edit a config file so I can type with my desired layout so I’m not going to. This makes Solaris nearly useless to me for any real uses as I don’t know qwerty well enough to touch type.

5. I don’t have permissions to turn off my computer. This one is weird. I’m not sure how something like this doesn’t get fixed before a release even if it is a developer preview release. When I try to shutdown from Gnome I get this error message “User does not have permissions to use gnome-sys-suspend command.” Do all the devs run as root?

I expect most of the bad things to go away so like I said I’m not going to complain about them. I don’t know if Indiana could ever make me want to use Solaris over Linux or BSD but it is an improvement and I will be happy to check out future releases of OpenSolaris. I think that If Sun keeps moving in this direction they could eventually move into the home pc market, but don’t count on it. Now I need to reinstall Fedora…

If you want to check out project Indiana head over there and give it a download.

 
Leave a comment

Posted by on November 3, 2007 in review

 

Tags: , ,