3 # Author: Alan J. Pippin
4 # Description: This script is a wrapper script that calls zfs-autosnap
5 # for each filesystem provided below.
7 # source our configuration
8 config="${0%/*}/zfs-scripts.conf"
9 [ -e "${config}.dist" ] && . ${config}.dist
10 [ -e "${config}" ] && . ${config}
12 # Setup some default values
13 logfile="$logdir/zfs-autosnap.log"
17 mylockdir="/tmp/zfs-autosnap-all"
19 # Make sure we aren't already running
20 if ! mkdir "$mylockdir" >/dev/null 2>&1; then
21 echo "$date Another $0 process is already running" >> $logfile
25 # Auto snapshot every zfs filesystem on the system specified below
29 zfs-autosnap storage /storage $numsnapshots 15
30 zfs-autosnap tank/usr/videos /usr/videos $numsnapshots 15
33 zfs-autosnap tank / $numsnapshots $maxagedays
34 zfs-autosnap tank/home /home $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