From owner-freebsd-geom@FreeBSD.ORG Wed Dec 27 17:57:26 2006 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A81316A403 for ; Wed, 27 Dec 2006 17:57:26 +0000 (UTC) (envelope-from arne_woerner@yahoo.com) Received: from web30312.mail.mud.yahoo.com (web30312.mail.mud.yahoo.com [209.191.69.74]) by mx1.freebsd.org (Postfix) with SMTP id 33E5413C487 for ; Wed, 27 Dec 2006 17:57:26 +0000 (UTC) (envelope-from arne_woerner@yahoo.com) Received: (qmail 44694 invoked by uid 60001); 27 Dec 2006 17:57:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=hcrNmaswJCopag4oxOsLOUy83FmTU1gAmYenUAiB/hthu6rwlwobihaYjaQXLoipjFAO8CFgjMiEeJIN15roW1ANapRHCqyxaGEp1N4MnmtgED5zbdIO3Xw3IPkHESOzNhTOvCivHTQUNk5MdDEqwzG6AXhOpcahKoBajhAJ+3g=; X-YMail-OSG: YVjsFScVM1kdIPDppeGfnPyRxhuCsDU7KyzeTm0xB87hWrmpgZ_aKnivONRzQq2JYXtA.I25HBGiJy4nqhJyuq_tR5Ruxb.ryowI_onkcHjt3_xYK3l439EobFfNWER6iPd6iU2ylK_s__k- Received: from [85.212.15.42] by web30312.mail.mud.yahoo.com via HTTP; Wed, 27 Dec 2006 09:57:21 PST Date: Wed, 27 Dec 2006 09:57:21 -0800 (PST) From: "R. B. Riddick" To: "R. B. Riddick" , Christian Laursen In-Reply-To: <20061227173527.18079.qmail@web30314.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <507320.43622.qm@web30312.mail.mud.yahoo.com> Cc: freebsd-geom@freebsd.org Subject: Re: geom_mirror delayed synchronizing question X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2006 17:57:26 -0000 --- "R. B. Riddick" wrote: > --- Christian Laursen wrote: > > No, -a and -n enables and disables autosynchronization. I want > > autosynchronization but with a delay. > > > Then just issue "gmirror configure -a" by need (delayed; e. g. from > /usr/local/etc/rc.d/gmirror-chk.sh) and disable it again, when sync is done > (or > started? I would have to test that...)... > I have an even better idea (quick hack): 0. Turn off auto-sync: "gmirror configure -n " 1. we could schedule a gmirror-chk.sh execution every 5 minutes: */5 * * * * /root/gmirror-chk.sh (note: crond is started after fsck) 2. /root/gmirror-chk.sh would look like this: #!/bin/sh gmirror status | grep / | cut -d/ -f2 | cut -d\ -f1 | \ while read dn ;do na="" fs=1 gmirror list $dn | \ while read ln ;do if [ `echo $ln | grep -c "^[1-9]"` -ne 0 ]; then if [ $fs -eq 1 ]; then fs=0 else na=`echo $ln | cut -d\ -f3` fi elif [ ! -z "$na" ]; then if [ `echo $ln | grep -c "Flags: SYNCHRONIZING"` -ne 0 ]; then gmirror rebuild $dn $na break fi fi done done [TESTED OK R6.1] -Arne __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com