用rsync实现网站镜像和备份

2020-01-30 11:34:56王振洲

 

rsync --port 8730 otherhost::

或者

rsync -e 'ssh -p 2002' otherhost:

 

Q:我如何通过rsync只复制目录结构,忽略掉文件呢?

A:rsync -av --include '*/' --exclude '*' source-dir dest-dir

 

Q:为什么我总会出现"Read-only file system"的错误呢?

A:看看是否忘了设"read only = no"了

 

Q:为什么我会出现'@ERROR: invalid gid'的错误呢?

A:rsync使用时默认是用uid=nobody;gid=nobody来运行的,如果你的系统不存在nobody组的话,就会出现这样的错误,可以试试gid = nogroup或者其它

 

Q:绑定端口873失败是怎么回事?

A:如果你不是以root权限运行这一守护进程的话,因为1024端口以下是特权端口,会出现这样的错误。你可以用--port参数来改变。

 

Q:为什么我认证失败?

A:从你的命令行看来:

 

你用的是:

>; bash$ rsync -a 144.16.251.213::test test

>; Password:

>; @ERROR: auth failed on module test

>;

>; I dont understand this. Can somebody explain as to how to acomplish this.

>; All suggestions are welcome.

 

应该是没有以你的用户名登陆导致的问题,试试rsync -a max@144.16.251.213::test test