From c00e82d49cf65624af91725a57a27bbcb75d3f0d Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 10 Feb 2019 19:33:37 -0700 Subject: [PATCH] Make logdir if it doesn't exist Change-Id: Idbfba60f25c6930984a1d5c48ef0223d58cb3638 --- zfs-rm-all-snaps | 2 +- zfs-scripts.conf.dist | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/zfs-rm-all-snaps b/zfs-rm-all-snaps index 73c0746..868bba5 100755 --- a/zfs-rm-all-snaps +++ b/zfs-rm-all-snaps @@ -15,7 +15,7 @@ zfs_pool=$1 snap_pattern=$2 if [[ -z "$zfs_pool" ]] || [[ -z "$snap_pattern" ]]; then - echo "Usage: $0 " + echo "Usage: $0 / " exit 1 fi diff --git a/zfs-scripts.conf.dist b/zfs-scripts.conf.dist index 40a7e4b..019ae87 100644 --- a/zfs-scripts.conf.dist +++ b/zfs-scripts.conf.dist @@ -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" -- 2.34.1