I'm reading this post and I don't fully follow the answer.
I wondered if I could modify this, what's it called, command redirect?
What I would like:
- Don't hang, use ampersand
&
to move on to the next command - Output the data generated by the command to file
data.json
- Any problems, error messages or issues running the command, output them to bqlog.txt
Is this possible?
E.g. I currently have this command:
bq query --max_rows=1000000 --use_legacy_sql=false --format=json --batch=true --headless=true 'select * from `ga4-extract.analytics_123456789.events_'"$RUNDATE"'`;' > data.json
It's failing after about 30 minutes and I cannot see the output or what the issue is. This is on a github actions runner and the console output of the workflow just gives a failed status but, unique to this workflow, no console output indicating the error.
I wanted to modify my command so that I can output to data.json like I already have, but then also move on to the next step of monitoring the bqlog.txt file with tail -F bqlog.txt