Working in node, I have a bash script that acts as glue for my build and deployment process. It calls npm, gulp, the AWS cli, and docker as well as a number of standard command-line tools (sed, grep, export, etc.) Many of those tools call other processes as well (babel and typescript, for example.
When I run this script manually, I see a ton of output in the console. When I automate the same script and try to output the results to a log file, a lot of what I saw in the console never appears.
The command I'm currently running looks like this:
NODE_ENV=sandbox ./bapc.sh >> /var/log/bapc.log 2>&1
How can I call the script so that everything winds up in the log file?
2>&1
should take care of redirecting STDERR to STDOUT already. Are you talking about static output which you still see in the console after the command exited when you scroll up, or are you maybe talking about dynamic output, like interactive progress bars or status lines that change throughout the execution time and are no longer visible in the console after the command exited?( NODE_ENV=sandbox ./bapc.sh ) >> /var/log/bapc.log 2>&1
and write the output redirection outside?