Skip to content

Work IT catching up with home IT

April 3, 2008

At long last my home directory in the Office has caught up with my home directory at home and the one on my laptop and now lives on ZFS. Even better the admins have delegated snapshot privileges for my home directory to me. So now I have a scrip that snapshots my home directory every time I insert my smart card:

#!/bin/ksh -p  now=$(date +%F-%T)  exec mkdir $HOME/.zfs/snapshot/user_snap_$now 

This is then called using utaction:

utaction -c ~/bin/sh/snap 

Which is in turn started automatically via the session magic that gnome does (Preferences->Sessions->Start Up Programs).


You will notice that I use mkdir to create the snapshot this is great as it allows me to run the script on an NFS client but does prevent me from doing a recursive snapshot which if I had other file systems I would like.

Update. I just realised that my nautilus script is now useful at work. Cool.

Advertisements

From → Solaris

4 Comments
  1. I don’t get why you are using mkdir rather than ‘zfs snapshot …’. Is the mkdir a shortcut to creating a snapshot or something else?

  2. Yes you can use mkdir to create snapshots and rmdir to delete them. It’s all rather neat.
    Why?
    I’m on an NFS client so to use the zfs command would involve hackery to find out the NFS server and then I would have to have login access to that server. I do but in principle I may not have.

  3. The ‘mkdir’ trick was new to me too, it’s very briefly documented here:
    http://docs.sun.com/app/docs/doc/817-2271/gebwa?a=view
    It was part of ZFS Delegated Administration which was integrated into OpenSolaris build 69 (June 2007). Currently scheduled for a Solaris 10 update.

  4. That’s really cool. Thanks for the tip!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: