What??
You want to create a cron job, it emails the results of the status of a raid array? Or ??
Code:
#!/bin/sh
# Email mdadm status
for i in '/dev/md0 /dev/md1 /dev/md2 /dev/md3'
do
/sbin/mdadm --detail $i > /customscripts/raid-report.txt
done
mail -s "raid report" user@domain.com < /customscripts/raid-report.txt
This script takes a space-separated list of md (raid) devices, runs a report, plunks in a txt file and then emails it.
(I tried to make it cleaner by setting the list to 'md0 md1 md2 md3' and the using /sbin/mdadm --detail /dev/$i but it only processes the first element, and errors out on the rest... unsure why)