I am writing a release script, which uses scp/sftp to get the the file from a remote server, we want to log the output of this script to a release.log file as well. I am using "tee" to achieve this, which works perfectly fine for everything, i mean standard out and error, but when it comes to progress of the file download(which takes time to copy), it doesn't show up on the console or in the file as well.
Output of scp without tee
frrinstd@loneqflocfd0034.uk.db.com:/apps/flowrisk/valservice/release/London/uat2/vs-server-2.1.16-21190-linux-amd64-frod-uat2-London-dist.zip /apps/flowrisk/uatldn/valservice
vs-server-2.1.16-21190-linux-amd64-frod-uat2-London-dist.zip 100% 78MB 39.1MB/s 00:02
Output of scp WITH tee
frrinstd@loneqflocfd0034.uk.db.com:/apps/flowrisk/valservice/release/London/uat2/vs-server-2.1.16-21190-linux-amd64-frod-uat2-London-dist.zip /apps/flowrisk/uatldn/valservice
Can someone please tell me how to make it to output the progress of scp/sftp command on the console with tee as well, so that user know what is happening?