summaryrefslogtreecommitdiff
path: root/etc/daily
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-02-06 19:57:38 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-02-06 19:57:38 +0000
commit34d6d1c72300256ff458b7330bb382f4eeef62fe (patch)
tree25918567000a61b0267b3976ef5ca9dd6ff97e46 /etc/daily
parentded48e01426d0da4cfc7363f36fd636a3ffbba9e (diff)
Print an explicit error if the backup volume is not present in
hw.disknames. This can only happen due to a failure or user error. In either case, silent failure makes it hard to discover and debug. Now it will be easy to spot in the daily mail. ok rob, schwarze
Diffstat (limited to 'etc/daily')
-rw-r--r--etc/daily7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/daily b/etc/daily
index 25d489429b2..93ab51ec224 100644
--- a/etc/daily
+++ b/etc/daily
@@ -1,5 +1,5 @@
#
-# $OpenBSD: daily,v 1.90 2017/07/10 11:18:48 bluhm Exp $
+# $OpenBSD: daily,v 1.91 2018/02/06 19:57:37 tb Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94
#
# For local additions, create the file /etc/daily.local.
@@ -90,7 +90,10 @@ while [ "X$ROOTBACKUP" = X1 ]; do
fi
rootbak=${rootbak#/dev/}
bakdisk=${rootbak%%?(.)[a-p]}
- sysctl -n hw.disknames | grep -Fqw $bakdisk || break
+ if ! sysctl -n hw.disknames | grep -Fqw $bakdisk; then
+ echo "Backup disk '$bakdisk' not present in hw.disknames."
+ break
+ fi
bakpart=${rootbak##$bakdisk?(.)}
OLDIFS=$IFS
IFS=,