X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-snapshot-totals-cron;h=7ac2f55e10607511526843603278a8480814f974;hb=393fb08e7b7479c43e97e9477e7c95d012b9ab53;hp=49779b80923e8372f6ffde8f33dc04a53ce21e10;hpb=0bc0c53b75f7b4aa0724c5da22caed66fe69de8f;p=zfs-ubuntu%2F.git diff --git a/zfs-snapshot-totals-cron b/zfs-snapshot-totals-cron index 49779b8..7ac2f55 100755 --- a/zfs-snapshot-totals-cron +++ b/zfs-snapshot-totals-cron @@ -1,11 +1,18 @@ #!/bin/bash -PATH=/usr/sbin:/sbin:/etc/bin:$PATH +# Place this script in your crontab to run daily. +# It produces a log file that can be parsed by the +# zfs-log-parser script to display a nice table +# showing how much space the snapshots are taking up. -snapshot_totals="zfs-snapshot-totals" -logfile="/var/log/zfs/zfs-snapshot-totals.log" +# source our configuration +config="${0%/*}/zfs-scripts.conf" +[ -e "${config}.dist" ] && . ${config}.dist +[ -e "${config}" ] && . ${config} + +logfile="$logdir/zfs-snapshot-totals.log" date >> $logfile -$snapshot_totals >> $logfile +zfs-snapshot-totals >> $logfile echo >> $logfile