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!
Can you please give me details about your script?
Actaully I need to create similar kind of script.
Just add the --synchronous to your command. Per the documentation it will keep a live connection to the server.
Adds the full refresh operation to the queue used by the Backgrounder process, to be run as soon as a Backgrounder process is available. If a Backgrounder process is available, the operation is run immediately. The refresh operation appears on the Background Tasks report.
During a synchronous refresh,
tabcmdmaintains a live connection to the server while the refresh operation is underway, polling every second until the background job is done.
I've use snippet of code by will replace the items in the quotes with what I really want.
refreshextracts --project "ZAutomatedDownloads" --workbook "TestParameterPassing" --synchronous --no-certcheck
Hope this helps.