1#!/bin/sh
2#
3# $DragonFly: src/etc/periodic/daily/160.clean-hammer,v 1.1 2008/10/22 20:15:55 swildner Exp $
4#
5# Snapshot/prune/reblock all HAMMER file systems
6#
7
8# If there is a global system configuration file, suck it in.
9#
10if [ -r /etc/defaults/periodic.conf ]
11then
12    . /etc/defaults/periodic.conf
13    source_periodic_confs
14fi
15
16case "$daily_clean_hammer_enable" in
17    [Yy][Ee][Ss])
18	echo ""
19	echo "HAMMER maintenance:"
20	case "$daily_clean_hammer_verbose" in
21	    [Yy][Ee][Ss])
22		verbose=-v;;
23	    *)
24		verbose=;;
25	esac
26
27	/usr/bin/lockf -k -t 0 /var/run/.daily.160.lck \
28	hammer $verbose cleanup $daily_clean_hammer_pfslist && rc=0;;
29
30    *)  rc=0;;
31esac
32
33exit $rc
34