BITPHONIC

Archive for April 2008

Scheduling nightly ZFS snapshots

with one comment

It’s not often that I post stuff like this on my blog, but it is quite often that I find myself digging around the ‘net for this kind of information.

I needed to make a little shell script to make nightly ZFS snapshots, with a two week retention time. The great thing about Solaris is that all of it’s core utilities, like date are, well, egregiously out of date. If this were Linux, I could throw date a “–date ’14 days ago'” argument and be done with it, but instead I must ask Perl for help!

There’s some additional logic in there to check to see if the host is the active partition in a Solaris Cluster (it checks for the existence of the “/mailstore” partition).

#!/bin/bash
# Cron job to keep two weeks worth of 
# daily ZFS snapshots on mailstore, calendar.

# Today's date
DATE=`date +%m%d%Y`

# Munge the 14 days ago date from perl. Note the 14.
AGO=`perl -e 'use POSIX qw(strftime); print strftime "%m%d%Y", localtime(time()-3600*24*14);'`

CHK=`df -k | grep mailstore | cut -d ' ' -f 1`

# Am I the active host? Exits quietly if false.
if [ -n "$CHK" ]; then

        CHKAGO=`zfs list | grep mailstore@$AGO | cut -d ' ' -f 1`

        # Are there two week old snaps?
        if [ -n "$CHKAGO" ]; then
                # Destroy two week old snaps
                zfs destroy mailstore@$AGO
                zfs destroy calendar@$AGO 
        fi

        # Create today's snaps
        zfs snapshot mailstore@$DATE
        zfs snapshot calendar@$DATE
fi

Written by Adam N. Copeland

April 30, 2008 - 9:14 pm at 9:14 pm

Posted in work

Hitchhiker’s Easter Egg in HP’s SSSU for Solaris

leave a comment »

Although HP doesn’t think it’s important to develop a Solaris x86 version of the StorageWorks Shell Scripting Utility, at least I can sleep comfortably knowing that the developers are instead wasting their time putting Hitchhiker’s Guide ASCII art into the source code:

Written by Adam N. Copeland

April 30, 2008 - 2:24 pm at 2:24 pm

Posted in work

A Modest Proposal

leave a comment »

A brilliant piece of social commentary lurking in the nether regions of livejournal which I found by reading Eddie Campbell’s internet log, The Fate of the Artist.

Men who comply with all of the above and still end up getting kicked in the balls will be advised that they were asking for it, and that women can’t be blamed for what happens when a man walks by with his crotch just hanging out there where it becomes a target of opportunity.

Written by Adam N. Copeland

April 30, 2008 - 2:07 pm at 2:07 pm

Posted in Uncategorized

The Onion

leave a comment »

Have I mentioned that I love The Onion?

“The United States should no longer act as the world’s police but instead as the world’s stripper, dressed as the police.”

Written by Adam N. Copeland

April 21, 2008 - 6:39 pm at 6:39 pm

Posted in Uncategorized

My online design portfolio

leave a comment »

Something I’ve been meaning to do for a long time is put up a portfolio of all the amateur design work I’ve been doing over the last couple of years. I finally got around to it!

http://hyperlogia.com/adam

I used a neat piece of software called Indexhibit that makes it very easy to create portfolio-type websites out of thin air.

My Online Design Portfolio

Written by Adam N. Copeland

April 17, 2008 - 10:19 pm at 10:19 pm

Posted in Uncategorized

A Real American

with one comment

Darren Mabee, of We Are The Seahorses (a band we’ve been on at least two bills with, IIRC) is a true American. I mean that, completely without irony. I may not be the Seahorses’ biggest fan myself, but I have to admit that I admire his uncompromising vision when it comes to having a good time:

Some people think I’m fun, other people think being fun is annoying, proving they like to smell their own farts

Some people never believed in Santa, never had a birthday party, never made a prank phone call, read too many books, watched too many films, never saw Back To The Future enough and are afraid to a get a little shit in their mouth sometimes… In the end, I have sex with their girlfriends and make their hipster clothes smell bad. I am the joke, they are the punchline.

Written by Adam N. Copeland

April 10, 2008 - 8:53 pm at 8:53 pm

Posted in Uncategorized

while i’m in a ranting mood

leave a comment »

21+ to be in a band at a bar? Our drummer can play, but not stick around afterwards? Even better, wait until we’ve spent all evening packing the van and getting there to give him a hard time? Fuck You, Management. Fuuuckk Yoouuu.

Written by Adam N. Copeland

April 10, 2008 - 6:13 pm at 6:13 pm

Posted in Uncategorized