3 # Author: Alan J. Pippin
4 # Description: This script is a wrapper script that calls zfs-autosnap
5 # for each filesystem provided below.
7 # Setup some default values
8 autosnap="/usr/local/etc/bin/zfs-autosnap"
9 logfile="/var/log/zfs/zfs-autosnap.log"
10 lockdir="/tmp/zfs-autosnap-all"
15 # Make sure we aren't already running
16 if ! mkdir "$lockdir" >/dev/null 2>&1; then
17 echo "$date Another $0 process is already running" >> $logfile
21 # Auto snapshot every zfs filesystem on the system specified below
25 $autosnap storage /storage $numsnapshots 15
26 $autosnap tank/usr/videos /usr/videos $numsnapshots 15
29 $autosnap tank / $numsnapshots $maxagedays
30 $autosnap tank/backup /backup $numsnapshots $maxagedays
31 $autosnap tank/usr /usr $numsnapshots $maxagedays
32 $autosnap tank/usr/home /usr/home $numsnapshots $maxagedays
33 $autosnap tank/usr/local /usr/local $numsnapshots $maxagedays
34 $autosnap tank/usr/local/etc /usr/local/etc $numsnapshots $maxagedays
36 # Daily filesystems (only perform these at midnight)
37 if [ `date +"%H:%M"` == "00:00" ]; then
38 echo "Performing Daily snapshots" >> $logfile
41 # Weekly filesystems (only perform these on Sunday at midnight)
42 if [ `date +"%H:%M:%u"` == "00:00:7" ]; then
43 echo "Performing Weekly snapshots" >> $logfile
44 $autosnap tank/var /var $numsnapshots 60
45 $autosnap tank/usr/local/var /usr/local/var $numsnapshots 60