I am trying to capture output from an install script (that uses scp) and log it. However, I am not getting everything that scp is printing out, namely, the progress bar. <
None of the answers here worked for me, I needed to recursively copy large directory with lot of files over long geo distance, so I wanted to log the progress (&& echo success! was by far not enough).
What I finally engineered and somehow worked was:
scp -vrC root@host:/path/to/directory . 2> copy.log &
With -v doing the trick of verbose logging (-C allows compression and -r recursion).
Grepping the logfile
grep file copy.log | wc -l
allowed me to see the number of files copied so far.