Make logdir if it doesn't exist
authorAlan J. Pippin <alan@pippins.net>
Mon, 11 Feb 2019 02:33:37 +0000 (19:33 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Mon, 11 Feb 2019 02:33:37 +0000 (19:33 -0700)
Change-Id: Idbfba60f25c6930984a1d5c48ef0223d58cb3638

zfs-rm-all-snaps
zfs-scripts.conf.dist

index 73c07465b7ccf4667accb739ee621f06224af7bd..868bba53dae88f376b18660cb81e71d2165a1a73 100755 (executable)
@@ -15,7 +15,7 @@ zfs_pool=$1
 snap_pattern=$2
 
 if [[ -z "$zfs_pool" ]] || [[ -z "$snap_pattern" ]]; then
-  echo "Usage: $0 <pool> <snapshot pattern>"
+  echo "Usage: $0 <pool>/<filesystem> <snapshot pattern>"
   exit 1
 fi
 
index 40a7e4ba282ee4c827a67cd596542249419e2054..019ae870353bcf9fbc442d316ce974e2df75c28f 100644 (file)
@@ -16,6 +16,7 @@ mailx=/usr/bin/mailx
 
 # specify the path to the logdir the ZFS scripts should dump their logs to
 logdir="/var/log/zfs"
+[[ ! -d "$logdir" ]] && mkdir "$logdir"
 
 # specify the name of the lockdir used when performing ZFS admin operations
 lockdir="/tmp/zfs-admin-lock"