linux rsync 学习笔记
2011-09-04 20:46
363 查看
part 1: 查看rsync 的manual
$ man rsync :
rsync(1) rsync(1)
NAME
rsync — a fast, versatile, remote (and local) file-copying tool
SYNOPSIS
Local: rsync [OPTION...] SRC... [DEST]
Access via remote shell:
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST
Access via rsync daemon:
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST
Usages with just one SRC arg and no DEST arg will list the source files instead of copying.
# rsync 的使用主要有两种模式, remote shell, rsync daemo, 这里主讲 remote shell 方式
part 2: rsync 的主要应用
以如下A、B两台计算机为例:
A: jia@jia-server-svn 172.16.2.142
B: jia@jia-server-001 172.16.2.84
在A 上:
push: 将 A上的文件、文件夹传递到 B上
$ rsync -avr ue_test jia@172.16.2.84:/home/jia
$ rsync -avr test jia@172.16.2.84:/home/jia
pull: 将B上的文件、文件夹传递到A上
$ rsync -avr jia@172.16.2.84:/home/jia/test.py /home/jia
$ rsync -avr jia@172.16.2.84:/home/jia/jia_svn_test /home/jia
对本地两个两个目录同步:
$ rsync -avr filename1 filename2
# 将filename1 中的文件同步至filename2, 即 filename2中的文件与filename1 一致
$ man rsync :
rsync(1) rsync(1)
NAME
rsync — a fast, versatile, remote (and local) file-copying tool
SYNOPSIS
Local: rsync [OPTION...] SRC... [DEST]
Access via remote shell:
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST
Access via rsync daemon:
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST
Usages with just one SRC arg and no DEST arg will list the source files instead of copying.
# rsync 的使用主要有两种模式, remote shell, rsync daemo, 这里主讲 remote shell 方式
part 2: rsync 的主要应用
以如下A、B两台计算机为例:
A: jia@jia-server-svn 172.16.2.142
B: jia@jia-server-001 172.16.2.84
在A 上:
push: 将 A上的文件、文件夹传递到 B上
$ rsync -avr ue_test jia@172.16.2.84:/home/jia
$ rsync -avr test jia@172.16.2.84:/home/jia
pull: 将B上的文件、文件夹传递到A上
$ rsync -avr jia@172.16.2.84:/home/jia/test.py /home/jia
$ rsync -avr jia@172.16.2.84:/home/jia/jia_svn_test /home/jia
对本地两个两个目录同步:
$ rsync -avr filename1 filename2
# 将filename1 中的文件同步至filename2, 即 filename2中的文件与filename1 一致
相关文章推荐
- linux学习笔记-rsync+crond定时备份服务
- Linux运维学习笔记之十一:同步工具之rsync和inotify
- 【Linux学习笔记】29:预定义变量和read命令
- Linux内核学习笔记:SMP、UMA、NUMA
- linux 0.11 学习笔记1
- 【2018.03.29学习笔记】【linux基础知识2.18-2.22】
- Linux学习笔记12——Unix中的进程
- 自己在linux上编译、链接、动态库和静态库的学习笔记
- Linux实践工程师学习笔记八
- 一篇非常好的linux学习笔记分享(Linux入门绝佳)
- 每天一个linux命令(22):文件查找命令 find 命令的参数详解---学习笔记
- Linux 路由 学习笔记 之九 路由缓存相关的数据结构及初始化
- linux学习笔记--nologin命令
- 学习笔记TF046:TensoFlow开发环境,Mac、Ubuntu/Linux、Windows,CPU版本、GPU版本
- Red hat Linux Enterprise 5.4 Edtion 学习笔记
- Linux 学习笔记---访问控制列表
- [伊达原创]linux学习笔记之(rescue)在 rescue 模式下修复 MBR
- linux系统管理操作指令学习笔记(三)管理好文件
- Linux菜鸟学习笔记(一)--Linux系统结构