within your script that runs the tabcmd refreshextract, after the extract finishes, then you can check the status via SQL looking at the finish_code. I believe a finish_code of 0 is success.
Also, see this post from yesterday. Viewing Tableau 9 Background Tasks Queued
SELECT subtitle || ' - ' || title || started_at || completed_at || notes
title = 'extract_name'
AND started_at >= '$start_ts'::TIMESTAMP without TIME zone
AND finish_code <> 0
I have used the query process to find out if the extract was done.
However, you need to take into account the following items into consideration. You don't really know when exactly the refresh will start after you submit the command and also you don't know exactly how long it will take to finish. So if you query the extract result right after submitting the refreshextract you might get the correct response you need.
In my job I waited a minute after submitting the refresh command prior to checking to see if it was complete. Lastly I check the status of the refresh for x number of minutes. My assumption is that is should finish in a default set time. If it went passed my time limit an error would be sent to look into it.
Our script gets a bit more fancy. After the tabcmd refreshextract is submitted and prior to checking whether it was successful or not, we have a loop that runs a small SQL every 30 seconds to see if the extract is pending, running, or complete.
This is exactly what I was looking for. Thank you!