HAMMER Utilities: Add the 'hammer softprune' command.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 31 May 2008 18:45:04 +0000 (18:45 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 31 May 2008 18:45:04 +0000 (18:45 +0000)
commite8969ef0d6a64bedcbd3bb00c18f66f5f8ce46e5
treebe83ef72f81b9e7f0df84eacf2599f8392dc06f4
parentf1785283a786f0c8700f71d28ae2a891c2888ea1
HAMMER Utilities: Add the 'hammer softprune' command.

Add a new hammer pruning command called 'hammer softprune'.  This command
is much simpler to use then the 'hammer prune' command.  You simply specify
a directory containing softlinks to HAMMER snapshots, typically in the form:
"<path_to_hammer_filesystem>/@@0x<16-char-transaction_id>".  The command
will scan the directory non-recursively, collect all the softlinks, extract
the transaction ids, and prune the HAMMER filesystem to contain only those
snapshots.

In addition, information created before the snapshot softlink with the
lowest transaction id is destroyed and information created after the
softlink with the highest transaction id is retained (remains fine-grained).

This gives the administrator an easy way to maintain official snapshots
while at the same time retaining our 'undo' capability by leaving recent
modifications intact.

A simple cron job or script coupled with the use of the 'hammer synctid'
can be used to create a snapshot softlink every so often, and older
snapshots can be cleaned out or thinned simply by removing the associated
softlinks, and then re-running 'hammer softprune' on the directory
containing the softlinks.

Unlike the 'hammer prune' command, the softprune command does not require
the time ranges for snapshots to be well-ordered.
sbin/hammer/Makefile
sbin/hammer/cmd_prune.c
sbin/hammer/cmd_softprune.c [new file with mode: 0644]
sbin/hammer/hammer.8
sbin/hammer/hammer.c
sbin/hammer/hammer.h