X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-autosnap;h=da650f53362fc2a35dca67aef2be9974b0f7aac4;hb=c322e317ccd7550337a622436db8e1e9bb48214c;hp=da9090635011700f3b876e2c06e03befe417540b;hpb=64e85d923d59ee7b95cb123f12bfa3750f42dc0f;p=zfs-ubuntu%2F.git diff --git a/zfs-autosnap b/zfs-autosnap index da90906..da650f5 100755 --- a/zfs-autosnap +++ b/zfs-autosnap @@ -5,10 +5,13 @@ # It also employs an intelligent algorithm to roll off, # or destroy, old snapshots. -PATH=/usr/sbin:/sbin:$PATH +# source our configuration +config="${0%/*}/zfs-scripts.conf" +[ -e "${config}.dist" ] && . ${config}.dist +[ -e "${config}" ] && . ${config} -if [ -z "$SNAP_UNDER_TEST" ]; then - exec >> /var/log/zfs/zfs-autosnap.log 2>&1 +if [[ -z "$SNAP_UNDER_TEST" ]]; then + exec >> $logdir/zfs-autosnap.log 2>&1 fi # This script makes the following assumptions/requirements: @@ -50,7 +53,6 @@ filesystem=$1 mountpoint=${2-/$1} numsnapshots=${3-12} maxagedays=${4-0} -lockdir="/tmp/zfs-admin-lock" pool=`echo "$filesystem" | awk -F '/' '{ print $1 }'` if [ -z "$filesystem" ] || [ -z "$mountpoint" ] || [ -z "$numsnapshots" ] || [ -z "$maxagedays" ]; then