Zend certified PHP/Magento developer

Modify 2>&1 so that output goes to a specific file and any errors or other output goes to a log file I can monitor?

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:

  1. Don’t hang, use ampersand & to move on to the next command
  2. Output the data generated by the command to file data.json
  3. 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