File: raidtools2.cron.daily

package info (click to toggle)
raidtools2 0.90.20010914-15
  • links: PTS
  • area: main
  • in suites: woody
  • size: 692 kB
  • ctags: 467
  • sloc: ansic: 2,861; sh: 187; makefile: 144
file content (18 lines) | stat: -rw-r--r-- 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# Cron job to check that raid devices are functional.
# On error cron will mail the fauly mdstat to root.
#   md.c appends (F) to a faulty device
#   raid1.c and raid5.c list devices as U (operational) or _ (not)
#   a _ device may be either hot, standby or bad
# Merlin Hughes <merlin@merlin.org> 

[ -e /proc/mdstat ] || exit 0 

mdstat=`cat /proc/mdstat`

if echo "$mdstat" | grep -q '\(F\)'; then
  echo 'WARNING: Some disks in your RAID arrays seem to have failed!'
  echo 'Below is the content of /proc/mdstat:'
  echo 
  echo "$mdstat"
fi