国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

CentOS5 + rsync 同步2臺服務器的文件

2019-11-02 16:16:42
字體:
來源:轉載
供稿:網友
Always use rsync over ssh

Since rsync does not provide any security while transferring data it is recommended that you use rsync over ssh . This allows a secure remote connection. Now let us see some examples of rsync.

rsync command common options--delete : delete files that don't exist on sender (system) -v : Verbose (try -vv for more detailed information) -e "ssh options" : specify the ssh as remote shell -a : archive mode -r : recurse into directories -z : compress file data Task : Copy file from a local computer to a remote server

Copy file from /www/backup.tar.gz to a remote server called openbsd.nixcraft.in

$ rsync -v -e ssh /www/backup.tar.gz jerry@openbsd.nixcraft.in:~

Output:

Password: sent 19099 bytes received 36 bytes 1093.43 bytes/sec total size is 19014 speedup is 0.99

Please note that symbol ~ indicate the users home directory (/home/jerry).

Task : Copy file from a remote server to a local computer

Copy file /home/jerry/webroot.txt from a remote server openbsd.nixcraft.in to a local computer /tmp directory:

$ rsync -v -e ssh jerry@openbsd.nixcraft.in:~/webroot.txt /tmp

Password

Task: Synchronize a local directory with a remote directory$ rsync -r -a -v -e "ssh -l jerry" --delete openbsd.nixcraft.in:/webroot/ /local/webrootTask: Synchronize a remote directory with a local directory$ rsync -r -a -v -e "ssh -l jerry" --delete /local/webroot openbsd.nixcraft.in:/webrootTask: Synchronize a local directory with a remote rsync server$ rsync -r -a -v --delete rsync://rsync.nixcraft.in/cvs /home/cvsTask: Mirror a directory between my "old" and "new" web server/ftp

You can mirror a directory between my "old" (my.old.server.com) and "new" web server with the command (assuming that ssh keys are set for password less authentication)

$ rsync -zavrR --delete --links --rsh="ssh -l vivek" my.old.server.com:/home/lighttpd /home/lighttpd

===================================================

當需要把服務器上的文件復制到另外的機器上,可用rsync來同步文件。

一、服務器端配置:

# yum -y install xinetd

# vi /etc/xinetd.d/rsync

將如下代碼

復制代碼 代碼如下:

service rsync

{

disable = yes

socket_type = stream

wait = no

user = root

server = /usr/bin/rsync

server_args = 主站蜘蛛池模板: 刚察县| 吴忠市| 永登县| 康保县| 花垣县| 大渡口区| 阿巴嘎旗| 益阳市| 伊春市| 莎车县| 金寨县| 乌拉特中旗| 拉萨市| 石狮市| 信阳市| 墨玉县| 剑阁县| 洛宁县| 文登市| 开江县| 吴桥县| 长岛县| 杨浦区| 石屏县| 凯里市| 剑川县| 隆德县| 中江县| 建湖县| 阳朔县| 安龙县| 托里县| 兰考县| 枣阳市| 左贡县| 张家界市| 米林县| 若尔盖县| 金寨县| 吉首市| 金寨县|