1. 程式人生 > >Linux下的數據備份工具rsync

Linux下的數據備份工具rsync

遠程 glin rsn file passwd dup 判斷 x86_64 linux下

rsync(remote sync): 遠程同步,可以本地同步數據,不會覆蓋以前的數據,而是先判斷已經存在的數據和新數據的差異,只有數據不同時才會把不相同的部分覆蓋。

# yum install rsync.x86_64 -y

本地同步

[root@apenglinux-001 ~]# rsync -av /etc/passwd /tmp/password
sending incremental file list
passwd

sent 959 bytes  received 31 bytes  1980.00 bytes/sec
total size is 885  speedup is 0.89

遠程同步(同步到另一臺機器,另一臺機器也需要安裝rsnyc)

[root@apenglinux-001 ~]# rsync -av /etc/passwd 192.168.221.20:/tmp/password
[email protected]'s password: 
sending incremental file list
passwd

sent 959 bytes  received 31 bytes  220.00 bytes/sec
total size is 885  speedup is 0.89

rsync的命令格式

rsync [option]... src dest
rsync [option]... src [user@]host:dest
rsync [option]... [user@]host:src dest
rsync [option]... [user@]host::src dest
rsync [option]... src [user@]host::dest


Linux下的數據備份工具rsync