Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 2009 15:08:04 -0400
From:      Steve Bertrand <steve@ibctech.ca>
To:        xorquewasp@googlemail.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ZFS scrub is finished?
Message-ID:  <4A58E314.4040808@ibctech.ca>
In-Reply-To: <20090711161132.GA74849@logik.internal.network>
References:  <20090711161132.GA74849@logik.internal.network>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
xorquewasp@googlemail.com wrote:
> Hello.
> 
> I'd like to write a little shell script to run 'zpool scrub' on
> my disks weekly. I have two zpools. The manual page says that only
> one 'scrub' can be active at a time.
> 
> Is there any reliable way to run 'zpool scrub X' and then run
> 'zpool scrub Y' when the first has finished?

Perhaps it is as simple as cron-ing something like the following (of
course, replace "zpool scrub" with my cat commands.

I have three commands below, the second one in place only to verify that
the commands 'did the right thing' by waiting for the first to finish.

Note that if your second scrub command requires the first to exit
without any errors, this will not be an appropriate solution, as you'll
obviously want to catch the error and cancel the second scrub:

% cat a.fil && sleep 3 && cat b.fil

[1] 29821
this is a
...
% this is b

[1]    Done     ( cat a.fil && sleep 3 && cat b.fil )

If you want to run it at the command line, simply throw another '&' at
the end of the entire command string to ensure that if your terminal
terminates, the process(es) will continue thereafter.

Steve

[-- Attachment #2 --]
0	*H
010	+0	*H
00CK9AbxIUw0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
090507231610Z
100507231610Z0B10UThawte Freemail Member10	*H
	steve@ibctech.ca0"0
	*H
0
DZ杙<2IⵀfrsE6q?0.>
S@Œ!V?A\Q
r-aZ
Ōf/0{OYQhɏߴ
F_\Q0BF=<_.a*3epeY|tݼcvlҷ+@piQA{2E9WN4[Z`h6VM/zPbd(GC^K6XV4j<t-0+0U0steve@ibctech.ca0U00
	*H
æ|85aQz-*3HG		.s*Fw*`HvFw;9ytƘn0taC/:WC+LÙ{Oq 1n00CK9AbxIUw0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
090507231610Z
100507231610Z0B10UThawte Freemail Member10	*H
	steve@ibctech.ca0"0
	*H
0
DZ杙<2IⵀfrsE6q?0.>
S@Œ!V?A\Q
r-aZ
Ōf/0{OYQhɏߴ
F_\Q0BF=<_.a*3epeY|tݼcvlҷ+@piQA{2E9WN4[Z`h6VM/zPbd(GC^K6XV4j<t-0+0U0steve@ibctech.ca0U00
	*H
æ|85aQz-*3HG		.s*Fw*`HvFw;9ytƘn0taC/:WC+LÙ{Oq 1n0?0
0
	*H
010	UZA10UWestern Cape10U	Cape Town10U
Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0)	*H
	personal-freemail@thawte.com0
030717000000Z
130716235959Z0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA00
	*H
0Ħ<UsUNʙZhup[v:aQP
0cZ,p+Z?qV˯<6$*+w=+>@dקe*TH<a@dr`00U00CU<0:08642http://crl.thawte.com/ThawtePersonalFreemailCA.crl0U0)U"0 010UPrivateLabel2-1380
	*H
HP.
fgCL!6-6/P p<ab:~t%Pb'qW%ݩ9 Oe_N4[5MwV!x!5$F]_eO1d0`0v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CAK9AbxIUw0	+0	*H
	1	*H
0	*H
	1
090711190804Z0#	*H
	1({gvM|MuN]i0R	*H
	1E0C0
*H
0*H
0
*H
@0+0
*H
(0	+71x0v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CAK9AbxIUw0*H
	1xv0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CAK9AbxIUw0
	*H
@ucFTĴJ
08)~HE	ДgݿdF
Jt>8nk妪ICwZ09MU~
vYl5x[ Et(Ӧ/#~8g*Vȋ	ۿG^ZFhfkD>s2hx! "x^o45nPw/ YM𽯠0uTv	K

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A58E314.4040808>