Collect messages from zpool export cmds and email those if it fails to export
[zfs-ubuntu/.git] / zfs-snapshot-totals-cron
index 726ce3c45801b01dfd60a2e59d01ec1b14a543b6..7ac2f55e10607511526843603278a8480814f974 100755 (executable)
@@ -1,8 +1,18 @@
 #!/bin/bash
 
-snapshot_totals="/usr/local/etc/bin/zfs-snapshot-totals"
-logfile="/var/log/zfs/zfs-snapshot-totals.log"
+# 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.
+
+# 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
+