projects
/
zfs-ubuntu
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added missing anchor to backup pool name filter
[zfs-ubuntu/.git]
/
zfs-scrub
diff --git
a/zfs-scrub
b/zfs-scrub
index 5d2fadde353aa8c1aa8948d7cee8ff16fd80c5ad..939c798b4c6339e2e0523a39903b2f0e513afd55 100755
(executable)
--- a/
zfs-scrub
+++ b/
zfs-scrub
@@
-6,11
+6,15
@@
# running at any given time. This serializes the zfs
# scrub process for any pool.
# running at any given time. This serializes the zfs
# scrub process for any pool.
-PATH=/usr/sbin:/sbin:/etc/bin:$PATH
+# source our configuration
+config="${0%/*}/zfs-scripts.conf"
+[ -e "${config}.dist" ] && . ${config}.dist
+[ -e "${config}" ] && . ${config}
+
+exec >> $logdir/zfs-scrub.log 2>&1
pools="$*"
maxsleeptime=360
pools="$*"
maxsleeptime=360
-mailto=root
if [ -z "$pools" ]; then
echo "-E- Usage: $0 <pools>"
if [ -z "$pools" ]; then
echo "-E- Usage: $0 <pools>"
@@
-36,7
+40,6
@@
do
date=`date`
echo "$date: Scrub started for zfs pool $i"
date=`date`
echo "$date: Scrub started for zfs pool $i"
- zpool import $i
zpool scrub $i
# Wait until the scrub completes, and check for any errors
zpool scrub $i
# Wait until the scrub completes, and check for any errors
@@
-60,8
+63,9
@@
do
zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1
if [ $? != 0 ]; then
# The scrub found errors
zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1
if [ $? != 0 ]; then
# The scrub found errors
- zpool status $i |
/usr/bin/
mailx -s "zpool scrub $i found errors" $mailto
+ zpool status $i |
$
mailx -s "zpool scrub $i found errors" $mailto
fi
done
fi
done
+