More on snapshots
I've been using rsnapshot for quite a while now, and I'm really happy with it. It's been saving my ass on several occasions already. To make access to certain snapshots easier, I've created a small "system" of NFS mounting and symlinks.
The general idea here is to setup a number of symlinks in the directories that I've performed snapshots of. For example, in my home directory I end up having these symlinks:
.daily.3 -> /misc/.snapshots/daily.3/server3/home/leif/
.daily.2 -> /misc/.snapshots/daily.2/server3/home/leif/
.daily.1 -> /misc/.snapshots/daily.1/server3/home/leif/
.daily.0 -> /misc/.snapshots/daily.0/server3/home/leif/
.weekly.1 -> /misc/.snapshots/weekly.1/server3/home/leif/
.weekly.0 -> /misc/.snapshots/weekly.0/server3/home/leif/
.monthly.0 -> /misc/.snapshots/monthly.0/server3/home/leif/
Setting up the NFS mount point
First of all, we need to have a read-only mount point where the actual mountpoints are stored. In my case, I use an automount map for /misc, like
.snapshots -ro server3:/export/.snapshots
Creating symlinks
This is all good and well, but we also need to maintain symlinks into the NFS mount point. I wrote a very simple Python script to recursively create symlinks. It's fairly configurable, using the PythonConfig style configuration file. Here's an example configuration:
[snaplinks]
base: /misc/.snapshots
exclude: daily\.[45] weekly\.2 monthly\.[1-9] quarterly\.[0-9] yearly\.[0-9]
max_depth: 1
#destination_subdir: .snapshot
[leif]
source: server3
directory: home/leif
destination: /home/leif
max_depth: 5
The snaplinks section provides global configurations and defaults, which you can override in individual sections. Beware, use this tool at your own risk, I've tested it quite a lot, but I'm sure there are still bugs.