parsecpython
parsecpython

Reputation: 615

redirect SCP output to file

I've tried:

scp -r file host:~/ 2>&1 | tee -a file.log
scp -r file host:~/ >file.log 2>&1
scp -r file host:~/ &>file.log 

and i only ever get a blank file. what am I doing wrong? the goal is to capture the output of the files transferred to the text file

Upvotes: 2

Views: 3557

Answers (1)

IBam
IBam

Reputation: 11844

You can achieve this using script:

script -q -c "scp -r file host:~/" > file.log

Upvotes: 1

Related Questions