本文介绍了使用 rsync 将文件从远程服务器复制到本地机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一旦我通过 ssh 连接到我的远程服务器,将所有文件从一个目录复制到我机器上的本地目录的命令是什么?
Once I've ssh'd into my remote server, what would the command be to copy all files from a directory to a local directory on my machine?
推荐答案来自本地机器:
rsync -chavzP --stats user@remote.host:/path/to/copy /path/to/local/storage从具有非标准 ssh 端口的本地计算机:
From your local machine with a non standard ssh port:
rsync -chavzP -e "ssh -p $portNumber" user@remote.host:/path/to/copy /local/path或者来自远程主机,假设您真的想以这种方式工作并且您的本地机器正在侦听 SSH:
Or from the remote host, assuming you really want to work this way and your local machine is listening on SSH:
rsync -chavzP --stats /path/to/copy user@host.remoted.from:/path/to/local/storage参见 man rsync 解释我常用的开关.
See man rsync for an explanation of my usual switches.
更多推荐
使用 rsync 将文件从远程服务器复制到本地机器
发布评论