Tuesday, January 25, 2005

Parts of Deepfreeze

This is a part of the deepfreeze program. Note that I'm using diff -ru to generate the differences between the Nth snapshot and today's snapshot. The really nice thing is I account for two things both that the target is different than the current one and that the file is now unique [ie having been deleted since the Nth snapshot was taken]

open(FP,"diff -ru --brief $SOURCE $TARGET 2>/dev/null |");
open(FP2, "|(cd $TARGET ; tar jcf $DESTINATION$SCRUBBED_TARGET.$SUFFIX -T -)");

while (){
s/: /\//g;
#this is if the file that was in TARGET is different than SOURCE
if (/^Files .* and (.*) differ$/){
$tmp = $1;
$tmp =~ s/$TARGET/\./;
print FP2 $tmp,"\n";
}
#this is if the file no longer lives in SOURCE at all
if (/^Only in ($TARGET.*)\n/){
$tmp = $1;
$tmp =~ s/$TARGET/\./;
print FP2 $tmp,"\n";
}
}

Work Backups

So I wrote two backup strategies at work lately. Both seem to work rather fine, but I can see that unless I document them somehow they are going to overlap in my brain and that would be bad.

The first one is the the snapshot.rb/deepfreeze.pl/rsync strategy. In this one, we take and do a synchronization to a target disk. Then each day we rotate this snapshot and any other snapshots on disk to older directory names. So disk.2 would be moved to disk.3 and disk.4 to disk.5. Depending on how many snapshots are in the disk the last one is removed each time we rotate. This is where deepfreeze.pl comes in. He basically goes in and checks to see what is different from this snapshot and the latest snapshot and then archives those differences in a tarball [archive file] on yet another disk. This means you get all the files that have been changed since the final snapshot was taken. This is cool and lets a person go back to any day as long as you have snapshots and tarballs and get file *at that day*. [Mental note: Check deepfreeze and see how it's diffing]

The second strategy is to take a timestamp file and find all the files on a drive that are newer than that file. Then tar them all up. Simple, eh? The other neat thing is that you can change the timestamp so that it says "Back up everything since 1969" for example and get a full backup. It's really smooth and makes backing up stuff on an odd schedule really easy. Just touch the file once a week to be a week old and it'll do a weekly backup. Touch it once a month and get one, two, or even three month backups depending on the date you specify.

Yeah it's cool.

Friday, January 21, 2005

Tada!

From those wacky guys who made the Basecamp site comesTa-da. This is basically a part of the basecamp code that has been extracted out so that those of us that just want a to do list can get one really easily. And share parts of it with the world and parts of it just keep to ourselves.

How can that be bad? Answer: It can't. And from reading the author's blog it took, 500 lines of code. That's it. That's nothing. Nada, zip, zero, naught.

Some of my computer science projects took more lines of code and did a lot less work. That's just amazing.

Thursday, January 20, 2005

rebecca blood :: ten tips for a better weblog

rebecca blood :: ten tips for a better weblog

Some of these tips are really spot on. Others are more of what should be common sense, but apparently is not. Such is the lot of the logger.

US right attacks SpongeBob video

BBC NEWS | Americas | US right attacks SpongeBob video

Ok, how stupid is this. Yes we can see that there is evil in the world. Yes it exists on our very doorstep. It does NOT take the form of small yellow cartoon characters waiting to seduce our children into becoming homosexuals. The evil is inside the people that think that it is. No child in their right mind thinks anything sexual about cartoon characters, unless those characters are doing something 'naughty'. Holding hands with your friends is not 'naughty'. Touch is one way we communicate friendship, caring and honesty. When I shake someone's hand it's not because I want to jump their bones, it's cause I am greeting them. I think some people need to get out and realize that if God wanted us to live apart from each other, we'd be predators like tigers.