Backing Up, Starting Over, Seeing Success

November 24th, 2005

It was often said about my late grandfather…

There are three ways to do things: the right way, the wrong way, and his way.

My mother and grandmother spent a lifetime learning how handle it when their husbands got into “Earl mode” and determined to do things in their own way. The gene that controls this is, unfortunately, very dominant. Having recieved this gene I have spent many frustrating hours of my life trying to do things in ways that make sense to me, suit my preference, and are ridiculous. In such cases it is often impossible for us to back up, reevaluate the situation, and take a new tack. Impossible because we become blind, solidly assured that our method, our solution has the maximum benefit.

I use “our” and “us” because it is helpful to blame my problem on genetics. Because it is somehow less obnoxious when I am not the only one who does this. Because if I can’t help it I can’t be made responsible for it. This is all wrong, but habitual. Pardon me. As the recipient of this gene I accept the mantle of Earl and the reponsibility for my own actions. Going forward this will not be considered explanation nor excuse for this behavior.

What follows is a perfect example from yesterday of how this gets me into trouble. The particulars of this may only make sense to you if you are a computer geek, but the story is the same. This specific example is so thouroughly documented because after spending so much time on it, I don’t want to forget what worked.

The unix system at work where my home directory lives creates a subdirectory called .snapshot and periodically copies the contents of the home directory, creating fifteen snapshots of its contents, stretching back through two weeks of time:


foo [bar:/homes/uu02/h/homedir/.snapshot]% ls
hourly.0 hourly.3 nightly.0 nightly.3 nightly.6
hourly.1 hourly.4 nightly.1 nightly.4 weekly.0
hourly.2 hourly.5 nightly.2 nightly.5 weekly.1

That’s all very nice and quite useful if I inadvertently delete some important document, but when I am going to create an offline backup of my home directory, I do not want to include the .snapshot directory tree. Without it, my home directory — including mail archives — are almost 1GB, why make it 16GB. The process for copying a directory is fairly straightforward (cp -r ...), but to copy “everything in the directory except…” is a bit different. Yesterday, I spent several hours trying to get various iterations of find -L home -not -path "*\.snapshot*" -exec cp -pv {} backup/ \; and even trying a little xargs magic, all without success (for reasons which are still not completely clear). After knocking away at this problem I looked out the window at about 8:30 pm and I had to call my brother to say “Dude! It is snowing! It won’t be long now before snowboarding season!” In that conversation he invited me to come have some wings with him and some of his friends. I decided that I had beaten my head against the problem enough hours for one day and went out for some chicken.

This morning when I woke up, my thoughts began to return to the directory copying problem and realized (this is critical) that I had been doing it all wrong yesterday. In fact, I should not be using find or cp, or even rsync (as suggested by one person I asked about it), I should be using tar! So, for posterity, here’s the command that eventually worked for me and the command that I used to verify that it seemed to work:

% tar --exclude="*\.snapshot*" -cf - csserve0/ | ( cd bACK/ ; tar -xpvf - )
% diff -sr csserve0/ bACK/csserve0/

I based the actual command I used on some notes I took dated January 20, 2001. This just shows how rusty my unix-foo is, but that is a topic for another post alone.

The take away lessons from this are:

  • avoid getting stuck on just one solution
  • evaluate all options; ALL options
  • don’t find -exec cp when you can tar
  • walking away from a problem sometimes helps solve it.
  • save your notes
Filed under: , ,

New look for the daemon

November 10th, 2005

I’ve always loved the daemon, and now the look has been updated and I love it all the more!

FreeBSD new logo banner

Filed under:

Protected: Keeping up FreeBSD

November 9th, 2005

This post is password protected. To view it please enter your password below:


Filed under: ,

Bad Atom

November 2nd, 2005

From:

http://www.brandonhutchinson.com/BadAtom_BadWindow_errors_with_ssh_X11_forwarding.html

Although I’m not sure if the “problem” resides in the version of XFree86 or the OpenSSH client or server version, I sometimes receive the following errors when using standard (ssh -X) X11 forwarding with OpenSSH:

warning, error event received:
X Error of failed request: BadAtom (invalid Atom parameter)
Major opcode of failed request: 18 (X_ChangeProperty)
Atom id in failed request: 0×1b3
Serial number of failed request: 944
Current serial number in output stream: 946

warning, error event received:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 25 (X_SendEvent)
Resource id in failed request: 0×16000d5
Serial number of failed request: 2055
Current serial number in output stream: 2056

Using “trusted” X11 forwarding (ssh -Y) appears to fix the problem. The ForwardX11Trusted=yes directive may be specified in ~/.ssh/config as an alternative to specifying the -Y flag on the command line.

Filed under: , ,

INCLUDE_CONFIG_FILE

September 20th, 2005
# This allows you to actually store this configuration file into
# the kernel binary itself, where it may be later read by saying:
# strings -n 3 /boot/kernel/kernel | sed -n ’s/^___//p’ > MYKERNEL
#
options INCLUDE_CONFIG_FILE # Include this file in kernel

Filed under: ,

dhclient.conf

February 10th, 2005

If the DHCP server is configured to update the DNS server, you can inject your hostname if you configure your /etc/dhclient.conf file correctly:


~> cat /etc/dhclient.conf
# $: src/etc/dhclient.conf,v 1.3 2001/10/27 03:14:37 rwatson Exp $
#
# This file is required by the ISC DHCP client.
# See “man 5 dhclient.conf” for details.
#
# In most cases an empty file is sufficient for most people as the
# defaults are usually fine.
#
send host-name “fully-qualified.domain.name”;

Yeah, it’s just one line, I know … but it took me a while to figure out the correct option to send and syntax to send it in. I’m not the admin of the DHCP or DNS server, so I’m not sure how much that impacts what configs are suitable for this setting.

Filed under:

Adding a disk, quickly

December 10th, 2004

This is my cheat sheet for adding a disk in FreeBSD. This information is geared for 5.x. No attempt at explanation is made. Caveat Emptor, sucka.


# dd if=/dev/zero of=/dev/da2 bs=1k count=1
# bsdlabel -Bw da2 auto
# newfs /dev/da2a
# echo ‘/dev/da2a /da2 ufs rw 2 2′ >> /etc/fstab
# mount /da2

Filed under: ,

Keeping FreeBSD up-to-date

December 8th, 2004

If you have ever said to yourself “I should find out what this CVSup thing is all about”, go read this article. Do it now.

Dru Lavigne r0×0rz

Filed under: ,

webserver logprocessor notes

November 12th, 2004

http://ftp.ics.uci.edu/pub/websoft/wwwstat/
+ simple, text
- cron runs regularly, even if nobody cares
- potential info leak, shows every link on box

http://awstats.sourceforge.net *
+ very nice, makes graphs
+ runs cgi, so only makes load when you make requests
+ lots of useless data, possibly inaccurate (country)

http://www.analog.cx/
+ most popular
+ extremely fast
+ some graphs, but less eye candy than awstats

also:
Port: sitebar-3.2.5
Path: /usr/ports/www/sitebar
Info: The Bookmark Server for Personal and Team Use
http://www.sitebar.org/

Filed under: , ,