-if [ `date +"%H:%M"` == "00:00" ]; then
- $autosnap tank/var /var $numsnapshots $maxagedays
- $autosnap tank/usr/local/var /usr/local/var $numsnapshots $maxagedays
+# midnight = true if (midnight < current time < midnight+5 min)
+if [[ $current_hour == "00" && $current_minute -lt 5 ]]; then
+ echo "Performing Daily snapshots" >> $logfile
+fi
+
+# Weekly filesystems (only perform these on Sunday at midnight)
+# midnight = true if (midnight < current time < midnight+5 min)
+if [[ $current_day == "7" && $current_hour == "00" && $current_minute -lt 5 ]]; then
+ echo "Performing Weekly snapshots" >> $logfile