Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsync: update Chinese translation #12193

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 17 additions & 16 deletions pages.zh/common/rsync.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# rsync

> 一种快速,通用,远程(和本地)文件复制工具。
> 一种快速,通用,远程(和本地)文件复制工具,默认使用 SSH。
> 如果要指定远程路径,请使用 `user@host:path/to/file_or_directory`.
> 更多信息:<https://download.samba.org/pub/rsync/rsync.1>.

- 从本地传输文件到远程主机
- 复制文件

`rsync {{path/to/local_file}} {{remote_host}}:{{path/to/remote_directory}}`
`rsync {{路径/到/来源}} {{路径/到/目标}}`

- 从远程主机传输文件到本地
- 使用归档模式递归拷贝文件,并保留所有属性,不解析软链接

`rsync {{remote_host}}:{{path/to/remote_file}} {{path/to/local_directory}}`
`rsync --archive {{路径/到/来源}} {{路径/到/目标}}`

- 将本地文件以归档模式并保留几乎所有属性,同时使用压缩功能传输到远程主机,并以人类可读方式输出详细信息和进度条:
- 将文件以归档模式并保留几乎所有属性进行传输,并以人类可读方式输出详细信息和进度条,中断时保留部分信息

`rsync --archive --compress --verbose --human-readable --progress {{path/to/local_file}} {{remote_host}}:{{path/to/remote_directory}}`
`rsync --compress --verbose --human-readable --partial --progress {{路径/到/来源}} {{路径/到/目标}}`

- 将远程主机目录上的所有文件,以递归模式传输到本地
- 以递归模式传输文件

`rsync --recursive {{remote_host}}:{{path/to/remote_directory}} {{path/to/local_directory}}`
`rsync --recursive {{路径/到/来源}} {{路径/到/目标}}`

- 将远程主机该目录下的所有内容(不包含该目录),以递归方式传输到本地
- 将目录下的所有内容(不包含该目录),以递归方式传输

`rsync --recursive {{remote_host}}:{{path/to/remote_directory}}/ {{path/to/local_directory}}`
`rsync --recursive {{路径/到/来源}}/ {{路径/到/目标}}`

- 递归方式传输目录,保留几乎所有属性,解析软连接,并忽略已传输的文件:
- 归档方式传输目录,保留几乎所有属性,解析软连接,并忽略已传输的文件:

`rsync --recursive --archive --update --copy-links {{remote_host}}:{{path/to/remote_file}} {{path/to/local_directory}}`
`rsync --archive --update --copy-links {{路径/到/来源}} {{路径/到/目标}}`

- 指定本地和远程之间通信方式
- 传输目录到运行 `rsyncd` 的远端,并删除目标目录中源目录中不存在的文件

`rsync --rsh ssh {{remote_host}}:{{path/to/remote_file}} {{path/to/local_file}}`
`rsync --recursive --delete rsync://{{host}}:{{路径/到/来源}} {{路径/到/目标}}`

- 指定本地和远程之间通信方式,使用指定端口,并显示进度条:

`rsync --rsh 'ssh -p {{port}}' --progress {{remote_host}}:{{path/to/remote_file}} {{path/to/local_file}}`
`rsync --rsh 'ssh -p {{端口}}' --info=progress2 {{host}}:{{路径/到/来源}} {{路径/到/目标}}`