rsync同步

简介

rsync 全名 Remote Sync,是类 unix 系统下的数据镜像备份工具。可以方便的实现本地,远程备份,rsync 提供了丰富的选项来控制其行为。rsync 优于其他工具的重要一点就是支持增量备份。

本地备份示列

0 * * * * rsync -arv --delete /home/bluexiii/Documents/work /media/bluexiii/HITACHI/Documents
0 * * * * rsync -arv --delete --exclude=.git --exclude=.svn --exclude=node_modules --exclude=target /home/bluexiii/Documents/src /media/bluexiii/HITACHI/Documents

远程备份示列

SSH公钥复制:

ssh-copy-id [email protected]

crontab配置:

0 * * * * rsync -arv /home/minio/data [email protected]:/home/minio/data

参考文档

  • https://www.jianshu.com/p/258ceb7b2223
  • https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps
  • http://einverne.github.io/post/2017/07/rsync-introduction.html

你可能感兴趣的:(rsync同步)