ZFS scrub is finished?
steve at ibctech.ca
Sat Jul 11 19:08:06 UTC 2009
xorquewasp at googlemail.com wrote:
> 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
this is a
% this is b
 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3233 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090711/9226113a/smime.bin
More information about the freebsd-questions