Work IT catching up with home IT

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.

Comments:

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?

Posted by Trev on April 04, 2008 at 02:44 AM BST #

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.

Posted by Chris Gerhard on April 04, 2008 at 02:56 AM BST #

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.

Posted by Peter Harvey on April 04, 2008 at 04:42 AM BST #

That's really cool. Thanks for the tip!

Posted by Trev on April 04, 2008 at 07:05 AM BST #

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today