BackupPC-users

Re: [BackupPC-users] Script for managing mdadm add/removes

2008-10-08 12:10:04
Subject: Re: [BackupPC-users] Script for managing mdadm add/removes
From: Rob Owens <rob.owens AT biochemfluidics DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 08 Oct 2008 12:06:26 -0400

dan wrote:
> Your best bet here is to use udev rule for the device
> 
Careful!  This will sync *any* drive that you plug in, won't it?  Or is
there a way to have a udev rule that applies to only a drive with a
specific UUID?

-Rob

> whenever the drive gets plugged in it should run the script
> 
> [SCRIPT1]
> add the device to the array so it can sync.
> 
> launch a script in the background that watches the sync and when it is
> 100% complete, remove the disk from the array. (use while and awk probably)
> eject the disk
> notify you via email.
> 
> make sure you are generous with `sleep` commands.  some things take a
> few seconds to settle so a 30 second wait here or there is a good thing.
> 
> 
> I will certainly give any help I can but I really suggest that you read
> this on writing udev rules http://reactivated.net/writing_udev_rules.html
> also, a quick while loop using awk to pull out the specific field you
> need for the while.  this shouldnt be terribly hard.
> eject /dev/sdb is pretty straightforward
> 
> it will be very helpfull for you to learn to do this so i suggest you
> put as much effort into this as you can before getting any help.
> 
> good luck.
> 
> 
> 
> 
> 
> On Mon, Oct 6, 2008 at 4:40 PM, Kim Pedersen <kim AT cncsltd DOT com
> <mailto:kim AT cncsltd DOT com>> wrote:
> 
> 
>     Hi everyone,
> 
>     I have been following the discussions about using Linux md raid1 as a
>     way of creating an offline copy of the pool filesystem, which method Les
>     Mikesell seems to be a big proponent of.
> 
>     I am about to try it out myself on an installation, where users will
>     connect an external harddrive to the BackupPC server and sync the drive
>     to the raid1 array using mdadm, and later disconnect it again for
>     offline/offsite storage.
> 
>     As this is something that will happen on a regular basis, I am looking
>     to automate it as much as practical (and possible) by writing a script
>     for the umount/fail/remove and recognition of the external drives.
> 
>     Might there be someone on the list who have taken a shot at this already
>     and be willing to share the code to get me jump started?
> 
> 
>     Regards,
> 
>     Kim Pedersen
> 
> 
> 
>     -------------------------------------------------------------------------
>     This SF.Net email is sponsored by the Moblin Your Move Developer's
>     challenge
>     Build the coolest Linux based applications with Moblin SDK & win
>     great prizes
>     Grand prize is a trip for two to an Open Source event anywhere in
>     the world
>     http://moblin-contest.org/redirect.php?banner_id=100&url=/
>     <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>     _______________________________________________
>     BackupPC-users mailing list
>     BackupPC-users AT lists.sourceforge DOT net
>     <mailto:BackupPC-users AT lists.sourceforge DOT net>
>     List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
>     Wiki:    http://backuppc.wiki.sourceforge.net
>     Project: http://backuppc.sourceforge.net/
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> BackupPC-users mailing list
> BackupPC-users AT lists.sourceforge DOT net
> List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
> Wiki:    http://backuppc.wiki.sourceforge.net
> Project: http://backuppc.sourceforge.net/
********************************************************

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this transmission in
error please notify the sender immediately and then delete this e-mail.
E-mail transmission cannot be guaranteed to be secure or error free as
information could be intercepted, corrupted lost, destroyed, arrive late or
incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of e-mail
transmission. If verification is required please request a hard copy
version.

********************************************************


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/