Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    52

    Default Software Raid one cron job

    Hello,

    How to create cron job software raid one and email should come to us?

    Please advise.

  2. #2
    Member
    Join Date
    Jan 2004
    Posts
    755

    Default

    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)
    Last edited by Lyttek; 05-05-2009 at 07:35 PM.

Similar Threads & Tags
Similar threads

  1. Adding RAID 1 (software)
    By Alex Stupar in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-09-2011, 01:22 PM
  2. WHM/CPANEL software RAID-1 addon?
    By devGOD in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-22-2008, 12:32 PM
  3. Software Raid 1 setup
    By bsasninja in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-16-2007, 11:23 AM
  4. Adding Software Raid?
    By edstout in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-08-2006, 05:17 PM
  5. Redhat 7.3 & Software Raid
    By mesranet in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-15-2002, 03:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube