Skip to content

nautilus meets zfs snapshots

September 6, 2007

After ZFS saved the day earlier in the week I wanted to get to the stage where the email to me was not required, at least if the user is on the a Solaris system.

So I’ve updated my zfs_versions script which you will recall prints out all the versions of a file that exist on a zfs file system. The new script has an additional flag so that it can better support a nautilus script that allows you to highlight a file, then it will list all the versions of that file, not all the snapshots, but all the distinct versions of the file.




Choose the show_versions script. In a fit of recursion you can see the example is for the show_versions script




Finally select the version you want:




It will then open a nautilus window in the directory that contains the version of the file. What is more it even works over NFS.

You need 2 scripts:

  1. zfs_versions, this must be in your path without the .tcl postfix.

  2. show_versions. This has to be stored in the .gnome2/nautilus-scripts directory in your home directory.

Make both scripts mode 755 and then run “nautilus -q”.

Things to note.

It considers the file to be the path to the file. So if you rename a file you will not see revisions with the old name. It would be really cool if there was a way to get all the versions of a file without resorting to doing an exhaustive search of the file system, but there is not.

I don’t know how to make the available to all users without messing in each ~/.gnome2 directory. If you do then add a comment.

Hat tip to Sandip for alerting me to nautilus scripts.

Advertisements

From → Solaris

5 Comments
  1. Nice one Chris. I did some other Nautilus integration over at http://blogs.sun.com/timf/entry/zfs_on_your_desktop
    – allowing you to view the current directory in any of the known snapshots, take new snapshots, list snapshots and destroy them.

  2. Nice, very nice.
    Now all you need to do is integrate a very fancy Compiz Fusion super-GUI and we’ll have Apple on the run. Or not.
    Need to get this script shipped as default with new Nevada builds.

  3. Calum Mackay permalink

    A quick Google suggests that you want:
    /usr/share/nautilus-scripts
    but I’ve not tried it.
    cheers,
    c.

  4. /usr/share/nautilus-scripts does not seem to be it.
    I’m now trying to think of a way to help users find files they have deleted, since clearly they can’t select them. However and exhaustive search takes a very very long time when you have thousands of snapshots.

  5. /usr/share/nautilus-scripts does not seem to be it.
    I’m now trying to think of a way to help users find files they have deleted, since clearly they can’t select them. However and exhaustive search takes a very very long time when you have thousands of snapshots.

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: