Added an already running check
[zfs-nexenta/.git] / zfs-snapshot-totals-cron
index 49779b80923e8372f6ffde8f33dc04a53ce21e10..7ac2f55e10607511526843603278a8480814f974 100755 (executable)
@@ -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