BITPHONIC

Archive for the ‘work’ Category

Traffic Caused by Inclement Weather

with one comment

traffic

Written by Adam N. Copeland

December 19, 2008 - 1:37 pm at 1:37 pm

Posted in Uncategorized, work

Installing ZFS as root filesystem on Solaris 10

with 2 comments

More bullshit from Sun.

From Sun’s documentation:

“In this Solaris release, you can perform an initial installation by using the Solaris interactive text installer to create a ZFS storage pool that contains a bootable ZFS root file system.”

What this really means, however, is that if you try to use the graphical installer for Solaris, the option to use ZFS as your root filesystem does not appear. You have to use the text installer. Which also means, if you want to customize packages (eg. You don’t need StarOffice or Evolution installed on a server OS), you have to use the painfully slow scrolling crappy text installer.

picture-2

Written by Adam N. Copeland

December 4, 2008 - 9:39 am at 9:39 am

Posted in work

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