首先rsync命令是单向同步,

rsync -avv left/ right/ 

right不会影响到left

排除文件(夹)

rsync -arv --exclude-from='/home/ben/exclude_me.txt' /home/ben /media/ben/thumbdrive/

exclude_me.txt

.ccache
build
.java
.gvfs
.xsession-errors
  • /dir/ means exclude the root folder /dir
  • /dir/* means get the root folder /dir but not the contents
  • dir/ means exclude any folder anywhere where the name contains dir/

远程到本地

rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine

本地到远程

rsync -a ~/dir1 username@remote_host:destination_directory

相关文章:

  • 2021-06-01
  • 2021-12-02
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-01
  • 2021-11-01
  • 2022-12-23
  • 2022-01-04
  • 2021-11-30
  • 2021-10-24
相关资源
相似解决方案