You want to create a cron job, it emails the results of the status of a raid array? Or ??
# Email mdadm status
for i in '/dev/md0 /dev/md1 /dev/md2 /dev/md3'
/sbin/mdadm --detail $i > /customscripts/raid-report.txt
mail -s "raid report" [email protected] < /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)