将SCP输出重定向到文件 [英] redirect SCP output to file

查看:419
本文介绍了将SCP输出重定向到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过:

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

推荐答案

您可以使用script:

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

这篇关于将SCP输出重定向到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆