最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】rsync如何同步本地的文件夹

Mac crifan 5247浏览 0评论

折腾:

【已解决】写Makefile实现commit提交文件到github.io仓库

期间,先去试试如何用rsync如何同步本地文件夹

从A目录同步拷贝到B目录

rsync 同步 本地文件夹

linux 下使用 rsync 进行文件 同步 – Daniel 的技术笔记 不积跬步无以至千里,不积小流无以成江海。 – CSDN博客

用 rsync 同步本地和服务器的文件 – youngdze – 博客园

使用rsync同步目录 – Mike_Zhang – 博客园

如何使用Rsync同步本地和VPS远程目录

RSync实现文件备份同步 · Wonux Blog

好像就是直接A和B目录就可以了。

【总结】

最后去用:

Makefile中:

OUTPUT_PATH = $(CURRENT_DIR)/$(OUTPUT_FOLDER_NAME)/$(BOOK_NAME)

GITHUB_IO_PATH=/Users/crifan/dev/dev_root/github/github.io/crifan.github.io

rsync -avzh –progress –stats –delete –force $(OUTPUT_PATH) $(GITHUB_IO_PATH)

即可:

把文件夹A:

/Users/crifan/GitBook/Library/Import/http_summary/output/http_summary

中的所有文件(递归的,全部的),同步到文件夹B:

/Users/crifan/dev/dev_root/github/github.io/crifan.github.io

详细log:

➜  http_summary git:(master) ✗ make commit

<span style="font-size: 12px; color: rgb(51, 51, 51); font-family: Monaco;"–<——————————————————————————

Author  : crifan.com

Version : 20171228

Function: Auto use gitbook to generated files: website/pdf/epub/mobi; upload to remote server; commit to github io repo

        Run ‘make help’ to see usage

<span style="font-size: 12px; color: rgb(51, 51, 51); font-family: Monaco;"–<——————————————————————————

rsync -avzh –progress –stats –delete –force /Users/crifan/GitBook/Library/Import/http_summary/output/http_summary /Users/crifan/dev/dev_root/github/github.io/crifan.github.io

building file list …

130 files to consider

http_summary/

http_summary/epub/

http_summary/epub/http_summary.epub

       4.10M 100%   21.41MB/s    0:00:00 (xfer#1, to-check=127/130)

http_summary/mobi/

http_summary/mobi/http_summary.mobi

       1.80M 100%    6.64MB/s    0:00:00 (xfer#2, to-check=125/130)

http_summary/pdf/

http_summary/pdf/http_summary.pdf

      22.56M 100%   18.26MB/s    0:00:01 (xfer#3, to-check=123/130)

http_summary/website/

http_summary/website/index.html

      21.53K 100%  116.79kB/s    0:00:00 (xfer#4, to-check=121/130)

http_summary/website/http_related/index.html

      19.89K 100%   37.78kB/s    0:00:00 (xfer#100, to-check=0/130)

Number of files: 130

Number of files transferred: 100

Total file size: 34.54M bytes

Total transferred file size: 34.54M bytes

Literal data: 34.54M bytes

Matched data: 0 bytes

File list size: 3821

File list generation time: 0.003 seconds

File list transfer time: 0.000 seconds

Total bytes sent: 32.86M

Total bytes received: 2.40K

sent 32.86M bytes  received 2.40K bytes  21.91M bytes/sec

total size is 34.54M  speedup is 1.05

转载请注明:在路上 » 【已解决】rsync如何同步本地的文件夹

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.175 seconds, using 22.14MB memory