[kwlug-disc] Sleep until command is finished

Khalid Baheyeldin kb at 2bits.com
Thu Jan 6 16:26:00 EST 2022


On Thu, Jan 6, 2022 at 2:15 PM John Sellens <jsellens at syonex.com> wrote:

> To accomplish your goal, I suspect you have to run smartctl to query
> the test's progress e.g. something like this:
>     while true ; do
>         smartctl -a /dev/sda | grep -q 'Self-test routing in progress'
>         if [ $? -ne 0 ]; then
>             echo test finished
>             break
>         fi
>     done


Or more concisely ...

watch -n5 "smartctl -a /dev/sda | grep -q 'Self-test routing in progress'"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220106/0b2a86e6/attachment.htm>


More information about the kwlug-disc mailing list